/* =========================================
   Sprint 15 — Consumer Authentication UX
   Mobile-first · max 1180px · ride-app feel
   ========================================= */

.auth-consumer {
    --auth-input-h: 56px;
    --auth-btn-h: 56px;
    --auth-radius: 16px;
    --auth-blue: #2563eb;
    --auth-blue-dark: #1d4ed8;
    --auth-text: #0f172a;
    --auth-muted: #64748b;
    --auth-border: #e2e8f0;
    --auth-bg: #f8fafc;
    --auth-ease: cubic-bezier(0.22, 1, 0.36, 1);
    padding: clamp(0.5rem, 1.5vw, 1rem) 0 clamp(0.5rem, 1vw, 1rem);
    min-height: min(calc(100dvh - var(--header-height, 72px) - 56px), 860px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 50%);
}

.auth-consumer__frame {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 3vw, 1.5rem);
    display: grid;
    grid-template-columns: minmax(0, 0.32fr) minmax(0, 0.68fr);
    gap: clamp(1rem, 2.5vw, 2rem);
    align-items: stretch;
}

/* ----- Hero (~30%) ----- */

.auth-consumer__hero {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(1rem, 2.5vw, 1.75rem);
    border-radius: 20px;
    background: linear-gradient(155deg, rgba(37, 99, 235, 0.12) 0%, rgba(255, 255, 255, 0.98) 50%, rgba(99, 102, 241, 0.06) 100%);
    border: 1px solid rgba(37, 99, 235, 0.14);
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.07);
    min-height: 0;
    overflow: hidden;
}

.auth-consumer__brand {
    flex-shrink: 0;
}

.auth-consumer__logo {
    margin-bottom: 0.35rem;
    line-height: 0;
}

.auth-consumer__logo .wr-brand-logo--hero {
    margin-bottom: 0;
}

.auth-consumer__tagline {
    margin: 0 0 0.5rem;
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--auth-text);
}

.auth-consumer__pillars {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--auth-muted);
    letter-spacing: 0.02em;
}

.auth-consumer__illustration {
    margin-top: auto;
    max-width: 100%;
}

.auth-consumer__illustration-svg {
    width: 100%;
    max-height: 160px;
    display: block;
}

.auth-illu-vehicle {
    animation: authVehicleMove 4s var(--auth-ease) infinite alternate;
}

.auth-illu-dot--1 { animation: authDotPulse 2s ease-in-out infinite; }
.auth-illu-dot--2 { animation: authDotPulse 2s ease-in-out 0.3s infinite; }
.auth-illu-dot--3 { animation: authDotPulse 2s ease-in-out 0.6s infinite; }

@keyframes authVehicleMove {
    from { transform: translateX(0); }
    to { transform: translateX(6px); }
}

@keyframes authDotPulse {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.55; }
}

/* ----- Main form area (~70%) ----- */

.auth-consumer__main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(0.5rem, 2vw, 1rem) 0;
    min-width: 0;
}

.auth-consumer__alerts {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.auth-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    font-size: 0.8125rem;
    line-height: 1.45;
    font-weight: 500;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.auth-toast__icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50%;
}

.auth-toast--success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.auth-toast--success .auth-toast__icon {
    background: #22c55e;
    color: #fff;
}

.auth-toast--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.auth-toast--error .auth-toast__icon {
    background: #ef4444;
    color: #fff;
}

.auth-toast ul {
    margin: 0;
    padding-left: 1rem;
}

/* ----- Cards & typography ----- */

.auth-consumer .auth-card {
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.auth-consumer .auth-card--wide {
    max-width: 560px;
}

.auth-consumer .auth-card--compact {
    max-width: 440px;
    text-align: center;
}

.auth-consumer .auth-card__eyebrow {
    font-size: 0.75rem;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--auth-blue);
    font-weight: 700;
}

.auth-consumer .auth-card__title {
    margin: 0 0 0.25rem;
    font-size: clamp(1.625rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--auth-text);
}

.auth-consumer .auth-card__subtitle {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--auth-muted);
    font-weight: 400;
}

.auth-consumer .auth-card__footer {
    margin-top: 1rem;
    font-size: 0.875rem;
}

/* ----- Status / success cards ----- */

.auth-status {
    text-align: center;
    padding: 1.25rem 1rem;
    border-radius: var(--auth-radius);
    background: #fff;
    border: 1px solid var(--auth-border);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    max-width: 420px;
    margin: 0 auto;
}

.auth-status__icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    font-weight: 700;
    background: rgba(37, 99, 235, 0.1);
    color: var(--auth-blue);
}

.auth-status__icon--success {
    background: #dcfce7;
    color: #16a34a;
}

.auth-status__icon--warn {
    background: #fef3c7;
    color: #d97706;
}

.auth-status__title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 700;
    color: var(--auth-text);
}

.auth-status__text {
    margin: 0 0 1rem;
    font-size: 0.9375rem;
    color: var(--auth-muted);
    line-height: 1.5;
}

.auth-consumer .auth-status .auth-card__footer {
    margin-top: 0.75rem;
    margin-bottom: 0;
}

.auth-consumer .auth-status .btn-premium {
    margin-top: 0.25rem;
}

/* ----- Form sections (register) ----- */

.auth-section {
    margin-bottom: 0.5rem;
    padding: 1rem;
    border-radius: var(--auth-radius);
    background: rgba(248, 250, 252, 0.85);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.auth-section + .auth-section {
    margin-top: 0.65rem;
}

.auth-section__title {
    margin: 0 0 0.65rem;
    padding-bottom: 0.45rem;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--auth-muted);
    border-bottom: 1px solid var(--auth-border);
}

.auth-section__fields {
    display: grid;
    gap: 0.75rem;
}

/* ----- Method chips (forgot password) ----- */

.auth-method-chips {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.auth-method-chip {
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    background: rgba(37, 99, 235, 0.08);
    color: var(--auth-blue-dark);
    border: 1px solid rgba(37, 99, 235, 0.15);
}

.auth-method-chip__or {
    font-size: 0.8125rem;
    color: var(--auth-muted);
    font-weight: 500;
}

/* ----- Inputs (56px) ----- */

.auth-consumer .auth-form {
    gap: 0.75rem;
}

.auth-consumer .form-group-modern {
    margin-bottom: 0;
    gap: 0.35rem;
}

.auth-consumer .form-label-modern {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    text-transform: none;
    letter-spacing: 0;
}

.auth-consumer .form-control-modern,
.auth-consumer .auth-password-wrap__input {
    min-height: var(--auth-input-h);
    height: var(--auth-input-h);
    padding: 0 1rem;
    font-size: 1rem;
    border-radius: var(--auth-radius);
    border: 1.5px solid var(--auth-border);
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.auth-consumer .auth-password-wrap__input {
    padding-right: 4.25rem;
}

.auth-consumer .form-control-modern::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.auth-consumer .form-control-modern:hover:not(:disabled):not(:focus) {
    border-color: #cbd5e1;
}

.auth-consumer .form-control-modern:focus,
.auth-consumer .auth-password-wrap__input:focus {
    border-color: var(--auth-blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    outline: none;
}

.auth-consumer .form-control-modern:disabled {
    background: #f1f5f9;
    color: #94a3b8;
}

.auth-consumer .form-control-modern:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
    box-shadow: 0 0 0 1000px #fff inset;
}

.auth-consumer .form-error {
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

.auth-consumer .form-alert--error {
    padding: 0.65rem 0.85rem;
    font-size: 0.8125rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

/* ----- Password hint (compact) ----- */

.auth-pw-hint {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--auth-muted);
    line-height: 1.4;
}

/* ----- Remember options ----- */

.auth-consumer .auth-remember-options {
    gap: 0.5rem;
    margin: 0.15rem 0;
}

.auth-consumer .checkbox-modern {
    margin-bottom: 0;
    gap: 0.5rem;
}

.auth-consumer .checkbox-modern__label {
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-consumer .checkbox-modern__help {
    display: none;
}

/* ----- Primary button ----- */

.auth-consumer .btn-premium {
    min-height: var(--auth-btn-h);
    height: auto;
    padding: 0 1.25rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--auth-radius);
    border: none;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.auth-consumer .btn-premium:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.42);
    color: #fff;
}

.auth-consumer .btn-premium:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

.auth-consumer .btn-premium:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.auth-consumer .btn-premium.btn-block {
    width: 100%;
}

.auth-consumer .btn-outline-premium {
    min-height: var(--auth-btn-h);
    border-radius: var(--auth-radius);
    font-size: 0.9375rem;
}

/* ----- Links ----- */

.auth-consumer .auth-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--auth-blue);
}

.auth-consumer .auth-link--small {
    font-size: 0.8125rem;
}

.auth-consumer .auth-muted {
    font-size: 0.875rem;
}

/* ----- Recovery actions ----- */

.auth-consumer .auth-recovery-actions {
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.auth-consumer .auth-recovery-actions__primary,
.auth-consumer .auth-recovery-actions__secondary {
    min-height: var(--auth-btn-h);
    padding: 0.75rem 1rem;
    border-radius: var(--auth-radius);
}

.auth-consumer .auth-recovery-actions__hint {
    font-size: 0.75rem;
    font-weight: 500;
}

/* ----- Compact footer on auth pages ----- */

.lyt-public-body:has(.auth-consumer) .lyt-public-footer {
    display: none;
}

/* =========================================
   Sprint 15.1 — Premium Polish
   ========================================= */

/* Fade-in micro animations */

.auth-fade-in {
    animation: authFadeIn 180ms var(--auth-ease) both;
}

.auth-fade-in--delay-1 { animation-delay: 40ms; }
.auth-fade-in--delay-2 { animation-delay: 80ms; }
.auth-fade-in--delay-3 { animation-delay: 120ms; }

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-fade-in,
    .auth-illu-vehicle,
    .auth-illu-dot--1,
    .auth-illu-dot--2,
    .auth-illu-dot--3 {
        animation: none !important;
    }

    .auth-consumer .btn-premium:hover:not(:disabled) {
        transform: none;
    }
}

/* Visually hidden labels */

.auth-consumer .form-label-modern--sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Leading icon inputs */

.auth-field-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
}

.auth-field-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: color 0.2s var(--auth-ease);
}

.auth-field-wrap:focus-within .auth-field-icon {
    color: var(--auth-blue);
}

.auth-field-wrap__input,
.auth-field-wrap .form-control-modern,
.auth-field-wrap .auth-password-wrap__input {
    padding-left: 2.85rem !important;
    width: 100%;
}

.auth-field-wrap .auth-password-wrap {
    flex: 1;
    min-width: 0;
}

.auth-field-wrap .auth-password-wrap__input {
    padding-right: 4.25rem !important;
}

/* Premium inline notices */

.auth-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    font-size: 0.8125rem;
    line-height: 1.45;
    font-weight: 500;
    margin-bottom: 0.65rem;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    border-left: 3px solid transparent;
}

.auth-notice::before {
    flex-shrink: 0;
    width: 1.35rem;
    height: 1.35rem;
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50%;
}

.auth-notice--error {
    background: #fff7f7;
    border-color: #fca5a5;
    color: #9f1239;
}

.auth-notice--error::before {
    content: "!";
    background: #fee2e2;
    color: #dc2626;
}

.auth-notice ul {
    margin: 0;
    padding-left: 1rem;
}

.auth-consumer .form-alert--error {
    display: none;
}

.auth-consumer .auth-notice.form-alert--error {
    display: flex;
}

/* Floating toast host */

.auth-float-host {
    position: fixed;
    top: calc(var(--header-height, 72px) + 0.75rem);
    right: 0.75rem;
    left: 0.75rem;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    pointer-events: none;
}

@media (min-width: 769px) {
    .auth-float-host {
        left: auto;
        width: min(380px, calc(100vw - 1.5rem));
        align-items: flex-end;
    }
}

.auth-float-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.7rem 0.85rem;
    border-radius: 14px;
    font-size: 0.8125rem;
    line-height: 1.45;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    pointer-events: auto;
    animation: authToastIn 160ms var(--auth-ease) both;
    border: 1px solid transparent;
}

.auth-float-toast--dismiss {
    animation: authToastOut 160ms var(--auth-ease) both;
}

@keyframes authToastIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes authToastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-6px); }
}

.auth-float-toast--success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.auth-float-toast--error {
    background: #fff7f7;
    border-color: #fecaca;
    color: #991b1b;
}

.auth-float-toast--warn {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.auth-float-toast--info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.auth-float-toast__icon {
    flex-shrink: 0;
    width: 1.35rem;
    height: 1.35rem;
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50%;
}

.auth-float-toast--success .auth-float-toast__icon {
    background: #22c55e;
    color: #fff;
}

.auth-float-toast--error .auth-float-toast__icon {
    background: #ef4444;
    color: #fff;
}

.auth-float-toast__close {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: inherit;
    opacity: 0.55;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 0.15rem;
    cursor: pointer;
    min-width: 28px;
    min-height: 28px;
}

.auth-float-toast__close:hover {
    opacity: 1;
}

.auth-float-toast__close:focus-visible {
    outline: 2px solid var(--auth-blue);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Button loading spinner */

.auth-btn-spinner {
    display: inline-block;
    width: 1.1rem;
    height: 1.1rem;
    margin-right: 0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: -0.15em;
    animation: authSpin 0.7s linear infinite;
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

.auth-consumer .btn-premium[aria-busy="true"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Success illustrations */

.auth-success-illu {
    margin: 0 auto 0.85rem;
    max-width: 120px;
}

.auth-success-illu__svg {
    width: 100%;
    height: auto;
    display: block;
}

.auth-status {
    padding: 1.1rem 1rem 1.25rem;
}

/* Auth compact footer */

.auth-consumer-footer {
    padding: 0.85rem 1rem 1rem;
    border-top: 1px solid var(--auth-border);
    background: #fff;
}

.auth-consumer-footer__inner {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.auth-consumer-footer__brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    line-height: 0;
}

.auth-consumer-footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 1rem;
}

.auth-consumer-footer__links a {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--auth-muted);
    text-decoration: none;
}

.auth-consumer-footer__links a:hover {
    color: var(--auth-blue);
}

.auth-consumer-footer__copy {
    margin: 0;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Enhanced input states */

.auth-consumer .form-control-modern:focus,
.auth-consumer .auth-password-wrap__input:focus,
.auth-field-wrap__input:focus {
    transform: scale(1.005);
}

.auth-consumer .form-control-modern:-webkit-autofill,
.auth-consumer .auth-field-wrap__input:-webkit-autofill {
    -webkit-text-fill-color: var(--auth-text);
    -webkit-box-shadow: 0 0 0 1000px #f0f7ff inset;
    box-shadow: 0 0 0 1000px #f0f7ff inset;
    transition: background-color 5000s ease-in-out 0s;
}

.auth-consumer .form-control-modern:disabled,
.auth-consumer .auth-field-wrap__input:disabled {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.85;
}

/* ----- Tablet ----- */

@media (max-width: 1024px) {
    .auth-consumer__frame {
        grid-template-columns: minmax(0, 0.35fr) minmax(0, 0.65fr);
        gap: 1.25rem;
    }

    .auth-consumer .auth-card__title {
        font-size: clamp(1.5rem, 3.5vw, 2rem);
    }
}

/* ----- Mobile: stacked, compact hero on top ----- */

@media (max-width: 768px) {
    .auth-consumer {
        min-height: auto;
        align-items: flex-start;
        padding-top: 0.5rem;
    }

    .auth-consumer__frame {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .auth-consumer__hero {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 0.75rem 1rem;
        gap: 0 0.75rem;
        min-height: auto;
    }

    .auth-consumer__brand {
        width: 100%;
    }

    .auth-consumer__logo .wr-brand-logo--hero {
        height: 72px;
    }

    .auth-consumer__tagline {
        flex: 1 1 auto;
        font-size: 1rem;
        margin-bottom: 0;
        line-height: 1.25;
    }

    .auth-consumer__pillars {
        margin: 0;
        font-size: 0.75rem;
        width: 100%;
    }

    .auth-consumer__illustration {
        display: none;
    }

    .auth-consumer__main {
        padding: 0;
    }

    .auth-consumer .auth-card__title {
        font-size: 1.625rem;
    }

    .auth-consumer .form-grid-two {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

@media (max-width: 430px) {
    .auth-consumer__frame {
        padding: 0 0.85rem;
    }

    .auth-consumer .auth-card__subtitle {
        font-size: 0.9375rem;
        margin-bottom: 0.75rem;
    }
}
