/* ==========================================================================
   Variables & reset
   ========================================================================== */
:root {
    --color-primary: #c03639;
    --color-primary-dark: #641415;
    --color-dark: #000;
    --color-text: #212529;
    --color-muted: #6c757d;
    --color-border: #ced4da;
    --color-error: #dc3545;
    --color-success: #198754;
    --radius: 0.375rem;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: "Montserrat", Arial, sans-serif;
    color: var(--color-text);
    background: var(--color-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   Header & footer
   ========================================================================== */
.navbar {
    background: var(--color-dark);
    padding: 15px;
    text-align: center;
}

.navbar .logo {
    width: 120px;
}

.footer {
    background: var(--color-dark);
    color: #fff;
    padding: 15px 20px;
    text-align: center;
    font-size: 14px;
}

/* ==========================================================================
   Hero / registration card
   ========================================================================== */
.hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: linear-gradient(to top, #000 0%, #4a4a4a 50%, #9e9e9e 100%);
}

.register-box {
    display: flex;
    max-width: 100%;
    /* Fixed height so the poster (9:16) can size itself from it without cropping */
    /* Also capped by viewport width so the image + wider form always fit side by side */
    --card-h: clamp(560px, min(calc(100dvh - 170px), calc((100vw - 32px) * 0.77)), 720px);
    height: var(--card-h);
    overflow: hidden;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.23);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(3px);
}

.register-image {
    /* The poster is text-heavy (9:16), so the box matches its ratio and nothing is cropped */
    flex: none;
    height: 100%;
    aspect-ratio: 9 / 16;
    background: #0b2a55 url("Investor.jpg") no-repeat center / cover;
}

.register-form {
    /* Image width = card height x 9/16 (0.5625). Form is 1.6x that, never less than 1.3x. */
    flex: 0 1 calc(var(--card-h) * 0.9);
    min-width: calc(var(--card-h) * 0.73);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 28px;
    background: whitesmoke;
}

.register-form h2 {
    margin-bottom: 8px;
    text-align: center;
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--color-primary);
}

.form-hint {
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--color-muted);
}

/* ==========================================================================
   Form
   ========================================================================== */
.form-group {
    margin-bottom: 16px;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font: inherit;
    font-size: 1rem; /* 16px prevents iOS zoom on focus */
    line-height: 1.5;
    color: var(--color-text);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control::placeholder {
    color: var(--color-muted);
    opacity: 1;
}

.form-control:focus {
    outline: 0;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-control:user-invalid {
    border-color: var(--color-error);
}

.form-text {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--color-muted);
}

/* intl-tel-input */
.iti {
    width: 100%;
}

.recaptcha-wrap {
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.form-message {
    margin-bottom: 16px;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    text-align: center;
}

.form-message.is-success {
    color: #0f5132;
    background: #d1e7dd;
}

.form-message.is-error {
    color: #842029;
    background: #f8d7da;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    font: inherit;
    font-size: 0.95rem;
    color: #fff;
    background: linear-gradient(109.6deg, var(--color-primary) 11.2%, var(--color-primary-dark) 56.8%);
    border: 0;
    border-radius: 41px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-group {
    display: flex;
    gap: 14px;
}

.btn-group .btn-submit {
    flex: 1 1 0;
    min-width: 0;
    font-size: 0.82rem;
}

@media (max-width: 768px) {
    .btn-group {
        flex-direction: column;
        gap: 12px;
    }
}

.btn-submit:hover:not(:disabled) {
    background: var(--color-dark);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* ==========================================================================
   Thank-you page
   ========================================================================== */
.thank-you-box {
    width: 100%;
    max-width: 420px;
    padding: 40px 24px;
    text-align: center;
    background: whitesmoke;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.thank-you-box .tick {
    width: 88px;
    height: 88px;
    margin-bottom: 20px;
}

.tick-circle {
    fill: var(--color-success);
}

.tick-check {
    fill: none;
    stroke: #fff;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: draw-tick 0.5s 0.2s ease-out forwards;
}

@keyframes draw-tick {
    to { stroke-dashoffset: 0; }
}

.thank-you-box p {
    font-size: 1rem;
    line-height: 1.5;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Tablet & below: stack the card, poster first (uncropped), then the form. */
@media (max-width: 768px) {
    .hero {
        align-items: flex-start;
    }

    .register-box {
        flex-direction: column;
        width: 100%;
        max-width: 480px;
        height: auto;
    }

    .register-form {
        flex: none;
        min-width: 0;
        padding: 24px 20px;
    }

    .register-image {
        height: auto;
        width: 100%;
    }
}

/* Small phones: shrink the fixed-width reCAPTCHA widget so it never overflows */
@media (max-width: 360px) {
    .register-form {
        padding: 20px 14px;
    }

    .recaptcha-wrap .g-recaptcha {
        transform: scale(0.88);
        transform-origin: center top;
    }
}
