/* ============================================================
   auth-v2.css
   Sign-in / sign-up shell — floating card on a soft background.

   Self-contained on purpose: login.html and register.html load
   THIS FILE ONLY (not auth-base.css / auth-banner.css), so there
   is no cascade fight with the old full-bleed split layout.
   ============================================================ */

:root {
    --av-navy:        #1D4E63;
    --av-navy-deep:   #143c4e;
    --av-ink:         #10303f;
    --av-red:         #D93535;
    --av-text:        #4a5b66;
    --av-muted:       #8496a2;
    --av-line:        #e4eaef;
    --av-line-strong: #d3dde5;
    --av-field:       #fbfcfd;
    --av-radius:      28px;
    --av-radius-sm:   10px;
}

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

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--av-text);
    background: #eaf0f7;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== BACKGROUND · soft corner blobs ===== */
.av-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(60% 50% at 12% 0%,   #dfe9f7 0%, rgba(223,233,247,0) 70%),
        radial-gradient(55% 45% at 92% 100%, #dbe8f6 0%, rgba(219,232,246,0) 70%),
        #eef3f9;
}

.av-blob {
    position: absolute;
    display: block;
    filter: blur(6px);
}

.av-blob--tl {
    top: -170px;
    left: -150px;
    width: 460px;
    height: 430px;
    background: linear-gradient(150deg, #c3d9f2 0%, #dde9f8 100%);
    border-radius: 52% 48% 60% 40% / 55% 45% 55% 45%;
    opacity: .75;
}

.av-blob--br {
    right: -160px;
    bottom: -190px;
    width: 480px;
    height: 440px;
    background: linear-gradient(320deg, #bcd5f0 0%, #dbe9f8 100%);
    border-radius: 46% 54% 40% 60% / 48% 52% 48% 52%;
    opacity: .7;
}

/* ===== STAGE · centres the card ===== */
.av-stage {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    /* dvh keeps the card centred while the mobile URL bar collapses/expands */
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 28px;
}

/* ===== CARD ===== */
.av-card {
    position: relative;
    width: min(1060px, 100%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    padding: 26px;
    border-radius: var(--av-radius);
    overflow: hidden;
    /* Gradient bleeds to the card edge; the form panel floats inset on top.
       Stops are weighted to the LEFT half — anything past ~60% across is
       hidden behind the form panel and does no visual work. */
    background:
        radial-gradient(58% 55% at 4% 0%,    #bcd7f2 0%, rgba(188,215,242,0) 62%),
        radial-gradient(55% 52% at 2% 100%,  #c3dbf3 0%, rgba(195,219,243,0) 60%),
        radial-gradient(62% 58% at 44% 50%,  #ffffff 0%, rgba(255,255,255,0) 68%),
        radial-gradient(80% 74% at 100% 6%,  #9dc2e8 0%, rgba(157,194,232,0) 55%),
        radial-gradient(76% 66% at 92% 100%, #9abfe6 0%, rgba(154,191,230,0) 58%),
        #e9f2fb;
    box-shadow:
        0 44px 88px -34px rgba(13, 42, 58, .34),
        0 4px 14px rgba(13, 42, 58, .05);
}

/* ===== LEFT · brand + pitch ===== */
.av-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 34px 26px 34px 34px;
    min-width: 0;
}

/* align-self is required: the column stretches items by default, which makes
   the <img> box full-width and object-fit then centres the artwork inside it */
.av-visual__logo {
    height: 50px;
    width: auto;
    align-self: flex-start;
    flex-shrink: 0;
    object-fit: contain;
    display: block;
}

/* Sits directly under the logo, top-aligned — the space below is
   deliberate breathing room, not something to centre into. */
.av-visual__copy {
    margin: 0;
    padding: 30px 0 0;
}

/* Trial hook — the reason someone lands here without an account */
.av-trial-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px 6px 10px;
    margin-bottom: 16px;
    border-radius: 30px;
    background: rgba(217, 53, 53, .1);
    border: 1px solid rgba(217, 53, 53, .22);
    color: #b62b2b;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
    /* On login this is an <a> to /register — kill the default underline */
    text-decoration: none;
    transition: background .18s ease, border-color .18s ease;
}

a.av-trial-pill:hover {
    background: rgba(217, 53, 53, .16);
    border-color: rgba(217, 53, 53, .34);
}

.av-trial-pill svg {
    flex-shrink: 0;
}

/* Carries the left column on its own now the artwork is gone */
.av-visual h1 {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: clamp(1.7rem, 2.4vw, 2.3rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.022em;
    color: var(--av-ink);
    margin-bottom: 15px;
    max-width: 15ch;
}

.av-visual__sub {
    font-size: .92rem;
    line-height: 1.62;
    color: #56707f;
    max-width: 36ch;
}


/* ===== RIGHT · form panel ===== */
.av-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
    border-radius: 20px;
    padding: 36px 38px 22px;
    min-width: 0;
    box-shadow:
        0 18px 40px -26px rgba(13, 42, 58, .3),
        0 1px 2px rgba(13, 42, 58, .04);
}

.av-panel__inner {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
}

.av-head {
    margin-bottom: 22px;
}

.av-head h2 {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--av-ink);
    margin-bottom: 5px;
}

.av-head p {
    font-size: .82rem;
    color: var(--av-muted);
}

/* ===== ERROR ===== */
.auth-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    margin-bottom: 16px;
    background: #fef3f3;
    border: 1px solid #fbd5d5;
    border-radius: var(--av-radius-sm);
    color: var(--av-red);
    font-size: .8rem;
    line-height: 1.45;
}

.auth-error svg {
    flex-shrink: 0;
}

/* ===== FIELDS ===== */
.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: .76rem;
    font-weight: 600;
    color: #23414f;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1.5px solid var(--av-line);
    border-radius: var(--av-radius-sm);
    background: var(--av-field);
    font-family: inherit;
    font-size: .875rem;
    color: var(--av-ink);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.form-input::placeholder {
    color: #a9b6c0;
}

.form-input:hover:not(:focus) {
    border-color: var(--av-line-strong);
}

.form-input:focus {
    outline: none;
    background: #fff;
    border-color: var(--av-navy);
    box-shadow: 0 0 0 3.5px rgba(29, 78, 99, .11);
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: .7rem;
    color: var(--av-muted);
}

/* Password field + eye toggle */
.av-field {
    position: relative;
}

.av-field .form-input {
    padding-right: 44px;
}

.av-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: none;
    color: #9aa8b2;
    cursor: pointer;
    transition: color .18s ease, background .18s ease;
}

.av-eye:hover {
    color: var(--av-navy);
    background: #eef3f6;
}

/* intl-tel-input (register only) */
.phone-input-group { width: 100%; }
.iti { width: 100%; display: block !important; }
.iti__flag-container { padding: 2px; }

.iti__selected-flag {
    background: #f1f5f8 !important;
    border-right: 1.5px solid var(--av-line) !important;
    border-radius: var(--av-radius-sm) 0 0 var(--av-radius-sm) !important;
    height: 44px !important;
}

.phone-number-input {
    border-radius: var(--av-radius-sm) !important;
    width: 100% !important;
}

/* ===== OPTIONS ROW ===== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 4px 0 18px;
}

.custom-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: .76rem;
    line-height: 1.5;
    color: var(--av-text);
}

.custom-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    width: 17px;
    height: 17px;
    margin-top: 1px;
    flex-shrink: 0;
    border: 1.5px solid #b6c2cb;
    border-radius: 5px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .16s ease, border-color .16s ease;
}

.custom-checkbox input[type="checkbox"]:checked + .checkmark {
    background: var(--av-navy);
    border-color: var(--av-navy);
}

.custom-checkbox input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

/* Keyboard focus ring — the native input is visually hidden */
.custom-checkbox input[type="checkbox"]:focus-visible + .checkmark {
    box-shadow: 0 0 0 3.5px rgba(29, 78, 99, .16);
}

.forgot-link,
.terms-link,
.terms-link:visited {
    color: var(--av-navy);
    font-size: .76rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: color .18s ease;
}

.terms-link {
    white-space: normal;
    font-weight: 600;
}

.forgot-link:hover,
.terms-link:hover {
    color: var(--av-navy-deep);
    text-decoration: underline;
}

/* ===== PRIMARY BUTTON ===== */
.btn-signin {
    width: 100%;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: var(--av-radius-sm);
    background: linear-gradient(180deg, #23596f 0%, var(--av-navy) 55%, #17455a 100%);
    color: #fff;
    font-family: inherit;
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .01em;
    cursor: pointer;
    box-shadow: 0 8px 20px -8px rgba(29, 78, 99, .55);
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.btn-signin:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.07);
    box-shadow: 0 12px 26px -8px rgba(29, 78, 99, .6);
}

.btn-signin:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 5px 14px -8px rgba(29, 78, 99, .55);
}

.btn-signin:disabled {
    opacity: .65;
    cursor: not-allowed;
    box-shadow: none;
}

.spinner { animation: av-spin 1s linear infinite; }

@keyframes av-spin {
    to { transform: rotate(360deg); }
}

/* ===== DIVIDER ===== */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--av-line);
}

.auth-divider span {
    font-size: .74rem;
    color: var(--av-muted);
    white-space: nowrap;
}

/* ===== SOCIAL ===== */
.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-social {
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1.5px solid var(--av-line);
    border-radius: var(--av-radius-sm);
    background: #fff;
    font-family: inherit;
    font-size: .85rem;
    font-weight: 600;
    color: #2c4453;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .16s ease, box-shadow .16s ease;
}

.btn-social:hover:not(:disabled) {
    background: #fafbfc;
    border-color: var(--av-line-strong);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -10px rgba(13, 42, 58, .4);
}

.btn-social:active:not(:disabled) {
    transform: translateY(0);
}

.btn-social:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.btn-social svg { flex-shrink: 0; }

/* ===== FOOTER ===== */
.auth-footer {
    text-align: center;
    margin-top: 18px;
    font-size: .82rem;
    color: var(--av-muted);
}

.register-link {
    color: var(--av-navy);
    font-weight: 700;
    text-decoration: none;
    transition: color .18s ease;
}

.register-link:hover {
    color: var(--av-navy-deep);
    text-decoration: underline;
}

/* Powered-by sits in the flow at the bottom of the panel */
.powered-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid #f0f3f6;
    font-size: .7rem;
    color: #a6b2bb;
    letter-spacing: .03em;
}

.powered-badge strong {
    color: var(--av-red);
    font-weight: 700;
    font-size: .72rem;
}

/* ===== FORGOT-PASSWORD MODAL ===== */
.av-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 60;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(10, 30, 41, .45);
    backdrop-filter: blur(3px);
}

.av-modal__box {
    width: 100%;
    max-width: 380px;
    padding: 30px 28px 26px;
    border-radius: 18px;
    background: #fff;
    text-align: center;
    box-shadow: 0 30px 60px -20px rgba(10, 30, 41, .4);
}

.av-modal__icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #eef5f8;
    color: var(--av-navy);
}

.av-modal__box h3 {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--av-ink);
    margin-bottom: 8px;
}

.av-modal__box p {
    font-size: .84rem;
    line-height: 1.6;
    color: var(--av-text);
    margin-bottom: 20px;
}

/* Secondary line in the modal — the spam-folder / Google-account aside, which
   should read as a footnote to the confirmation above it, not a second claim. */
.av-modal__note {
    font-size: .78rem;
    line-height: 1.55;
    color: var(--av-text);
    opacity: .72;
    margin-top: -8px;
}

.av-modal__btn {
    padding: 10px 30px;
    border: none;
    border-radius: var(--av-radius-sm);
    background: var(--av-navy);
    color: #fff;
    font-family: inherit;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s ease;
}

.av-modal__btn:hover {
    background: var(--av-navy-deep);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Short desktop viewports — tighten so the card still fits */
@media (min-width: 981px) and (max-height: 780px) {
    .av-stage       { padding: 24px; }
    .av-visual__copy{ padding-top: 22px; }
    .av-panel       { padding: 26px 34px 18px; }
    .av-head        { margin-bottom: 16px; }
    .form-group     { margin-bottom: 11px; }
    .auth-divider   { margin: 14px 0; }
    .powered-badge  { margin-top: 16px; padding-top: 12px; }
}

@media (min-width: 981px) and (max-height: 660px) {
    .form-input,
    .btn-social     { height: 40px; }
    .btn-signin     { height: 42px; }
    .av-visual h1   { font-size: 1.55rem; }
}

/* ── Tablet & below: stack into one column ── */
@media (max-width: 980px) {
    .av-stage {
        padding: 24px 18px;
        align-items: flex-start;
    }

    .av-card {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 20px;
        max-width: 560px;
    }

    /* Brand block becomes a compact banner above the form */
    .av-visual {
        padding: 12px 12px 0;
        flex-direction: row;
        align-items: center;
        gap: 16px;
    }

    .av-visual__logo {
        height: 40px;
        flex-shrink: 0;
    }

    .av-visual__copy {
        margin: 0;
        padding: 0;
        min-width: 0;
    }

    .av-trial-pill {
        margin-bottom: 8px;
        padding: 5px 11px 5px 8px;
        font-size: .62rem;
    }

    .av-visual h1 {
        font-size: 1.12rem;
        line-height: 1.3;
        margin-bottom: 0;
        max-width: none;
    }

    /* The pitch paragraph is desktop-only: beside a 40px logo it wraps to
       four lines and pushes the form off-screen. The h1 carries the message. */
    .av-visual__sub {
        display: none;
    }

    .av-panel {
        padding: 26px 26px 18px;
    }
}

/* ── Phone: brand banner becomes a centred stack ── */
@media (max-width: 560px) {
    .av-stage {
        padding: 14px 12px 22px;
    }

    .av-card {
        gap: 14px;
        padding: 14px;
        border-radius: 22px;
        box-shadow: 0 24px 50px -28px rgba(13, 42, 58, .38);
    }

    /* Side-by-side breaks down here — the logo lockup is wide enough that the
       headline is left with ~140px and wraps three or four times. */
    .av-visual {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
        padding: 6px 4px 0;
    }

    .av-visual__logo {
        height: 34px;
        align-self: center;
        max-width: 100%;
    }

    .av-visual__copy {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .av-trial-pill {
        margin-bottom: 9px;
        font-size: .58rem;
        letter-spacing: .04em;
    }

    .av-visual h1 {
        font-size: 1.02rem;
        max-width: 22ch;
    }

    .av-panel {
        padding: 22px 18px 16px;
        border-radius: 16px;
    }

    .av-head h2 { font-size: 1.28rem; }

    .form-input,
    .btn-social { height: 46px; }

    /* 16px is the threshold below which iOS zooms the page on focus */
    .form-input {
        font-size: 16px;
    }

    .iti__selected-flag { height: 46px !important; }

    .btn-signin { height: 48px; }

    /* Roomier tap target than the 32px desktop button */
    .av-eye {
        width: 38px;
        height: 38px;
        right: 4px;
    }

    .form-options {
        flex-wrap: wrap;
        gap: 10px;
    }

    .custom-checkbox,
    .forgot-link { font-size: .8rem; }

    .av-modal__box {
        padding: 26px 20px 22px;
    }
}

/* Very small phones */
@media (max-width: 380px) {
    .av-stage { padding: 10px 8px 18px; }
    .av-card  { padding: 12px; }
    .av-panel { padding: 20px 14px 14px; }
    .av-visual h1 { font-size: .96rem; }
}

/* Landscape phones — vertical room is the scarce resource, so the banner
   collapses back to a single row and the pill goes. */
@media (max-width: 980px) and (max-height: 520px) and (orientation: landscape) {
    .av-visual {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 14px;
        padding: 4px 8px 0;
    }

    .av-visual__copy { align-items: flex-start; }
    .av-visual__logo { height: 30px; }
    .av-trial-pill   { display: none; }
    .av-visual h1    { font-size: .95rem; max-width: none; }

    .av-card  { gap: 12px; }
    .av-head  { margin-bottom: 14px; }
    .form-group { margin-bottom: 10px; }
    .auth-divider { margin: 12px 0; }
}

/* ============================================================
   COMPACT VARIANT — .av-card--compact
   Sign-up carries four fields plus the terms block, which pushes the
   card past 100vh on a laptop. These rules squeeze the panel so it
   fits without an internal scrollbar.

   Desktop-only on purpose: below 981px the page stacks and scrolls,
   and these higher-specificity rules would otherwise override the
   stacked/phone sizing further down.

   Placed last so it also wins over the short-viewport tiers above.
   ============================================================ */
@media (min-width: 981px) {

    .av-card--compact .av-panel {
        padding: 26px 32px 16px;
    }

    .av-card--compact .av-head {
        margin-bottom: 14px;
    }

    .av-card--compact .av-head h2 {
        font-size: 1.3rem;
    }

    .av-card--compact .av-head p {
        font-size: .78rem;
    }

    .av-card--compact .form-group {
        margin-bottom: 9px;
    }

    .av-card--compact .form-label {
        margin-bottom: 4px;
    }

    .av-card--compact .form-input,
    .av-card--compact .btn-social {
        height: 40px;
    }

    /* Must track the input height or the flag button desyncs from the field */
    .av-card--compact .iti__selected-flag {
        height: 40px !important;
    }

    .av-card--compact .form-hint {
        margin-top: 4px;
        font-size: .66rem;
    }

    /* Needs real top margin: on sign-up this row follows the password hint,
       and at 2px the two lines of small text ran together. */
    .av-card--compact .form-options {
        margin: 9px 0 13px;
    }

    .av-card--compact .custom-checkbox {
        font-size: .72rem;
        line-height: 1.45;
    }

    .av-card--compact .btn-signin {
        height: 42px;
    }

    .av-card--compact .auth-divider {
        margin: 12px 0;
    }

    .av-card--compact .auth-footer {
        margin-top: 12px;
    }

    .av-card--compact .powered-badge {
        margin-top: 14px;
        padding-top: 10px;
    }
}

/* Shorter laptops — trim the form's padding. Nothing in the left column is
   touched here: it must stay pixel-identical to sign-in at every height. */
@media (min-width: 981px) and (max-height: 820px) {
    .av-card--compact .av-panel { padding: 20px 30px 14px; }
    .av-card--compact .av-head { margin-bottom: 11px; }
    .av-card--compact .form-group { margin-bottom: 7px; }
}

@media (min-width: 981px) and (max-height: 760px) {
    .av-card--compact .form-input,
    .av-card--compact .btn-social,
    .av-card--compact .iti__selected-flag { height: 38px !important; }
    .av-card--compact .btn-signin { height: 40px; }
    .av-card--compact .auth-divider { margin: 9px 0; }
    .av-card--compact .form-hint { display: none; }
}

/* Netbook-class heights — last things to go before we let it scroll */
@media (min-width: 981px) and (max-height: 670px) {
    .av-card--compact .av-head p { display: none; }
    .av-card--compact .av-head { margin-bottom: 9px; }
    .av-card--compact .auth-footer { margin-top: 9px; }
    .av-card--compact .powered-badge { margin-top: 9px; padding-top: 8px; }
}

/* Small desktop windows — reclaim the card's own padding */
@media (min-width: 981px) and (max-height: 630px) {
    .av-card--compact { padding: 18px; }
    .av-card--compact .av-panel { padding: 16px 26px 12px; }
    .av-card--compact .form-group { margin-bottom: 5px; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .btn-signin,
    .btn-social,
    .form-input,
    .av-eye {
        transition: none;
    }

    .btn-signin:hover:not(:disabled),
    .btn-social:hover:not(:disabled) {
        transform: none;
    }
}
