/*
 * components/auth-page.css
 *
 * What:  Split sign-in / sign-up page matching the mockup.
 *          Web (≥ 900px): branding panel (left) + form card (right).
 *          Mobile (< 900px): branding stacks on top of the card.
 * Why:   The user supplied a two-panel auth mockup and asked for an
 *        exact match on web + the stacked mobile variant.
 * Used:  Loaded by views/_layout.ejs; markup in views/auth/signin.ejs.
 *        Country picker + OTP/profile steps reuse the shared bits.
 */

.auth-split {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    background: #fff;
}

/* ── Branding panel ───────────────────────────────────────────────── */
.auth-brand2 {
    position: relative;
    background:
        radial-gradient(120% 80% at 80% 0%, #FFE0D8 0%, transparent 60%),
        linear-gradient(160deg, #FFF1EC 0%, #FFE6DE 100%);
    padding: var(--space-12) var(--space-12) var(--space-10);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}
.auth-brand2__home { display: inline-block; margin-bottom: var(--space-8); }
.auth-brand2__logo { height: 48px; width: auto; display: block; }
.auth-brand2__title { font-size: 3rem; line-height: 1.08; font-weight: 800; letter-spacing: -0.02em; color: var(--color-text); }
.auth-brand2__title em { color: var(--color-primary); font-style: normal; }
.auth-brand2__subtitle { margin-top: var(--space-4); color: var(--color-text-muted); font-size: 1.05rem; max-width: 34ch; }
.auth-brand2__features { list-style: none; margin: var(--space-8) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-5); }
.auth-feat { display: flex; align-items: center; gap: var(--space-3); }
.auth-feat__icon {
    width: 46px; height: 46px; border-radius: 50%; background: #fff;
    display: grid; place-items: center; font-size: 1.3rem; flex: 0 0 auto;
    box-shadow: var(--shadow-1); color: var(--color-primary);
}
.auth-feat__title { font-weight: 700; }
.auth-feat__sub { color: var(--color-text-muted); font-size: 0.85rem; }
.auth-brand2__pills { display: none; }   /* mobile only */

/* ── Decorative food collage on the branding panel ────────────────── *
 * Placeholder food emoji on tinted discs (no photo assets yet),
 * arranged in the lower-right like the mockup's burger/pasta/drink
 * cluster, with a 50% OFF speech bubble + a location pin. Absolutely
 * positioned so it never pushes the title/features around. */
.auth-brand2__art { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.auth-brand2 > *:not(.auth-brand2__art) { position: relative; z-index: 1; }   /* text above art */

.auth-brand2__badge {
    position: absolute; top: 30%; right: 20%;
    background: var(--color-primary); color: #fff;
    border-radius: 16px 16px 16px 4px; padding: 0.55rem 0.9rem;
    box-shadow: 0 8px 20px rgba(229,37,42,0.35);
    transform: rotate(-6deg); text-align: center; line-height: 1.1;
}
.auth-brand2__badge strong { display: block; font-size: 1.25rem; font-weight: 800; }
.auth-brand2__badge span { font-size: 0.7rem; opacity: 0.95; }

.af {
    position: absolute; border-radius: 50%;
    display: grid; place-items: center;
    box-shadow: var(--shadow-2);
}
.af--burger { width: 150px; height: 150px; background: #fff; bottom: 10%;  right: 8%;  font-size: 4.5rem; }
.af--pasta  { width: 180px; height: 180px; background: #fff; bottom: -4%;  right: 30%; font-size: 5.5rem; }
.af--drink  { width: 86px;  height: 86px;  background: #fff; bottom: 34%;  right: 6%;  font-size: 2.6rem; }
/* leaves + tomato — small accents, no disc */
.af--leaf, .af--tomato { box-shadow: none; background: transparent; }
.af--leaf-1 { font-size: 1.6rem; bottom: 46%; right: 34%; transform: rotate(20deg); }
.af--leaf-2 { font-size: 1.4rem; bottom: 18%; right: 52%; transform: rotate(-30deg); }
.af--tomato { font-size: 1.8rem; bottom: 40%; right: 44%; }
.auth-pin { position: absolute; top: 22%; right: 30%; font-size: 1.8rem; }

/* ── Form card ────────────────────────────────────────────────────── */
.auth-card2 {
    position: relative;
    align-self: center;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: var(--space-10) var(--space-8);
}
.auth-card2__back {
    position: absolute; top: var(--space-5); left: var(--space-5);
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--color-bg-alt); color: var(--color-text);
    display: grid; place-items: center;
}
.auth-card2__back:hover { background: rgba(0,0,0,0.08); color: var(--color-primary); }
.auth-card2__title { text-align: center; font-size: 1.7rem; font-weight: 800; }
.auth-card2__subtitle { text-align: center; color: var(--color-text-muted); margin-top: var(--space-1); }

/* Tabs — Login / Sign up. Underline marks the active one. Both lead
 * to the same OTP flow (visual only). */
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: var(--space-6) 0 var(--space-5); border-bottom: 1px solid var(--color-border-soft); }
.auth-tab {
    appearance: none; border: 0; background: transparent; cursor: pointer;
    padding: var(--space-3) 0; font-size: 1rem; font-weight: 700;
    color: var(--color-text-muted); position: relative;
}
.auth-tab.is-active { color: var(--color-primary); }
.auth-tab.is-active::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -1px;
    height: 2px; background: var(--color-primary); border-radius: 2px;
}

/* Mobile-number block. */
.signin-form__label { display: block; font-weight: 700; margin-bottom: var(--space-2); }
.signin-form__row { display: flex; gap: var(--space-2); }
.country-chip {
    display: inline-flex; align-items: center; gap: var(--space-1);
    background: #fff; border: 1px solid var(--color-border);
    border-radius: var(--radius-md); padding: 0 var(--space-3);
    height: 52px; cursor: pointer; flex: 0 0 auto; font-weight: 600;
}
.country-chip__flag { font-size: 1.1rem; }
.country-chip__arrow { color: var(--color-text-soft); }
.signin-form__input {
    flex: 1 1 auto; min-width: 0; height: 52px;
    border: 1px solid var(--color-border); border-radius: var(--radius-md);
    padding: 0 var(--space-4); font-size: 1rem; outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.signin-form__input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(229,37,42,0.12); }
.signin-form__error { color: var(--color-primary); font-size: 0.85rem; margin: var(--space-2) 0 0; }

.auth-continue {
    width: 100%; height: 54px; margin-top: var(--space-4);
    border: 0; border-radius: var(--radius-md); cursor: pointer;
    background: var(--color-primary); color: #fff; font-weight: 700; font-size: 1.05rem;
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    transition: background-color 120ms ease;
}
.auth-continue:hover { background: var(--color-primary-dark); }

/* Divider. */
.auth-divider { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-5) 0; color: var(--color-text-soft); font-size: 0.85rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--color-border-soft); }

/* Social buttons — full width, icon + label. */
.auth-socials2 { display: flex; flex-direction: column; gap: var(--space-3); }
.auth-social2 {
    display: flex; align-items: center; justify-content: center; gap: var(--space-2);
    height: 50px; border: 1px solid var(--color-border); border-radius: var(--radius-md);
    background: #fff; color: var(--color-text); font-weight: 600;
}
.auth-social2:hover { background: var(--color-bg-alt); border-color: var(--color-text-soft); }

/* USP icons row. */
.auth-usps { list-style: none; margin: var(--space-6) 0 0; padding: var(--space-4) 0 0; border-top: 1px solid var(--color-border-soft); display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); }
.auth-usps li { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 0.72rem; font-weight: 600; color: var(--color-text); }
.auth-usps__icon { font-size: 1.2rem; }

.auth-form__legal { margin-top: var(--space-5); text-align: center; font-size: 0.82rem; color: var(--color-text-muted); }
.auth-form__legal a { color: var(--color-primary); font-weight: 700; }

/* ── Mobile (< 900px) — form card only, no branding panel ─────────── *
 * Per the user: drop the top branding band on mobile, show just the
 * login form full-screen. */
@media (max-width: 899px) {
    .auth-split { grid-template-columns: 1fr; min-height: 100vh; background: #fff; }
    .auth-brand2 { display: none; }

    .auth-card2 {
        max-width: 560px;
        margin: 0 auto;
        background: #fff;
        border-radius: 0;
        box-shadow: none;
        padding: var(--space-10) var(--space-5) var(--space-10);
    }
    .auth-card2__back { top: var(--space-4); left: var(--space-4); }
}
@media (max-width: 420px) {
    .auth-usps { gap: var(--space-1); }
    .auth-usps li { font-size: 0.66rem; }
}

/* ── Plain single-card auth steps (OTP verify + Personal details) ───── *
 * Steps 2 & 3 (views/auth/otp.ejs + profile.ejs) are `bare` full-screen
 * flows that reuse ONE centred card. They use the older .auth-page /
 * .auth-form / .otp-* / .profile-* markup (the split-panel .auth-split is
 * step 1 only). Those classes had no rules after the step-1 redesign, so
 * the boxes + buttons stretched edge-to-edge — these styles restore the
 * focused, centred card. */
.auth-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: var(--space-10) var(--space-4) var(--space-12);
    background: #fff;
}
.auth-form {
    position: relative;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.auth-back {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--color-text); text-decoration: none;
    font-weight: 600; font-size: 0.95rem;
    margin-bottom: var(--space-6);
}
.auth-back:hover { color: var(--color-primary); }

.auth-form__title { font-size: 1.9rem; font-weight: 800; margin: 0; letter-spacing: -0.01em; }
.auth-form__title--centered { text-align: center; }
.auth-form__subtitle { color: var(--color-text-muted); margin: var(--space-2) 0 0; line-height: 1.5; }
.auth-form__subtitle--centered { text-align: center; }
.otp-phone { color: var(--color-text); font-weight: 700; }

/* OTP — six square digit boxes in a centred row. */
.otp-form { margin-top: var(--space-7); }
.otp-row { display: flex; gap: var(--space-2); justify-content: center; }
.otp-box {
    flex: 1 1 0; min-width: 0; max-width: 58px; aspect-ratio: 1 / 1;
    border: 1.5px solid var(--color-border); border-radius: var(--radius-md);
    background: #fff; text-align: center; font-size: 1.5rem; font-weight: 700;
    color: var(--color-text); outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.otp-box:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(229,37,42,0.12); }
.otp-box.is-filled { border-color: var(--color-primary); }
.otp-timer { text-align: center; color: var(--color-text-muted); font-size: 0.9rem; margin: var(--space-5) 0 var(--space-6); }
.otp-timer__countdown { color: var(--color-text); font-weight: 700; }
.otp-submit { margin-top: var(--space-2); }

/* Personal details (step 3) — stacked outlined fields + choice chips. */
.profile-form { margin-top: var(--space-6); text-align: left; }
.profile-field { margin-bottom: var(--space-5); }
.profile-field__label { display: block; font-weight: 700; margin: 0 0 var(--space-2); }
.profile-field__hint { color: var(--color-text-soft); font-weight: 500; font-size: 0.85rem; }
.profile-field__input {
    width: 100%; height: 52px; box-sizing: border-box;
    border: 1px solid var(--color-border); border-radius: var(--radius-md);
    padding: 0 var(--space-4); font-size: 1rem; outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.profile-field__input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(229,37,42,0.12); }

.diet-row { display: flex; gap: var(--space-3); }
.filter-row { display: flex; flex-direction: column; gap: var(--space-3); }
.diet-chip, .filter-chip {
    flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    min-height: 50px; padding: 0 var(--space-4);
    border: 1.5px solid var(--color-border); border-radius: var(--radius-md);
    background: #fff; color: var(--color-text); font-weight: 600; font-size: 0.95rem; cursor: pointer;
    transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}
.diet-chip:hover, .filter-chip:hover { border-color: var(--color-primary); }
.diet-chip.is-selected, .filter-chip.is-selected {
    border-color: var(--color-primary); background: var(--color-primary-soft); color: var(--color-primary);
}
.diet-chip__icon { font-size: 1.1rem; }
.profile-submit { margin-top: var(--space-6); }
.profile-caption { text-align: center; color: var(--color-text-soft); font-size: 0.82rem; margin: var(--space-3) 0 0; }

/* Phone: a touch more breathing room + slightly smaller OTP boxes. */
@media (max-width: 480px) {
    .auth-page { padding: var(--space-6) var(--space-4) var(--space-10); }
    .otp-box { font-size: 1.25rem; }
    .diet-row { flex-wrap: wrap; }
}
