/**
 * MS Freshora — Auth pages (presentation only)
 * CRITICAL: Do not rename IDs/classes referenced by Django forms or JS.
 */

:root {
    --auth-green: #16a34a;
    --auth-green-dark: #15803d;
    --auth-green-light: #22c55e;
    --auth-ink: #111827;
    --auth-muted: #64748b;
    --auth-border: #e2e8f0;
    --auth-surface: #ffffff;
    --auth-soft: #f8fafc;
    --auth-radius: 14px;
    --auth-radius-lg: 18px;
    --auth-radius-xl: 24px;
    --auth-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

/* ─── Shared shell ─── */
.auth-wrapper,
.otp-wrapper {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--auth-soft);
    padding: 24px 16px 48px;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
    width: 100%;
    max-width: 960px;
    gap: 0;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-xl);
    box-shadow: var(--auth-shadow);
    overflow: hidden;
}

.auth-brand-panel {
    background: linear-gradient(160deg, #0f172a 0%, #14532d 100%);
    color: #fff;
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.auth-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 22px;
    margin-bottom: 4px;
}

.auth-brand-panel h2 {
    font-size: clamp(22px, 2.5vw, 28px);
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.auth-brand-panel p {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
    max-width: 320px;
}

.auth-brand-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.auth-brand-list li {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    padding-left: 20px;
    position: relative;
    line-height: 1.5;
}

.auth-brand-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--auth-green-light);
}

.auth-form-panel {
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ─── Cards (login / register inner) ─── */
.auth-card,
.otp-card {
    width: 100%;
    max-width: none;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.auth-content {
    position: relative;
}

.auth-badge {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--auth-green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 14px;
}

.auth-title,
.otp-title,
.auth-page-title {
    font-size: clamp(22px, 2.8vw, 26px);
    font-weight: 800;
    text-align: center;
    margin: 0 0 6px;
    color: var(--auth-ink);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.auth-subtitle,
.otp-subtitle,
.auth-page-subtitle {
    text-align: center;
    color: var(--auth-muted);
    margin: 0 0 28px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.55;
}

/* ─── Forms ─── */
.auth-card .form-floating,
.auth-form-panel .form-floating {
    margin-bottom: 16px;
}

.auth-card .form-control,
.auth-form-panel .form-control,
.otp-card .form-control {
    height: 52px;
    border-radius: var(--auth-radius);
    border: 1px solid var(--auth-border);
    font-size: 14px;
    font-weight: 500;
    color: var(--auth-ink);
    background: var(--auth-surface);
    padding: 0 14px;
}

.auth-card .form-control:focus,
.auth-form-panel .form-control:focus,
.otp-card .form-control:focus {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
    border-color: var(--auth-green-light);
    outline: none;
}

.form-floating label {
    color: var(--auth-muted);
    font-weight: 600;
    font-size: 13px;
}

.form-check {
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    border-radius: 5px;
    border-color: #cbd5e1;
    margin: 0;
}

.form-check-input:checked {
    background-color: var(--auth-green);
    border-color: var(--auth-green);
}

.form-check-label {
    color: #475569;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.password-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -4px 0 14px;
}

.password-option .form-check {
    margin: 0;
}

/* ─── Register password UX ─── */
.password-hint {
    background: var(--auth-soft);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    padding: 14px;
    margin-bottom: 14px;
}

.hint-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.hint-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--auth-ink);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hint-status {
    font-size: 12px;
    font-weight: 800;
    color: #dc2626;
    white-space: nowrap;
}

.hint-status.ok {
    color: var(--auth-green);
}

.rule {
    font-size: 13px;
    font-weight: 700;
    color: #dc2626;
    margin: 4px 0;
}

.rule.ok {
    color: var(--auth-green);
}

.strength-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 10px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    background: #dc2626;
    border-radius: 999px;
    transition: 0.25s ease;
}

.message-text {
    font-size: 13px;
    font-weight: 700;
    min-height: 20px;
    margin-top: -4px;
    margin-bottom: 12px;
}

/* ─── Buttons ─── */
.auth-btn,
.verify-btn,
.auth-form-panel .btn-success {
    height: 52px;
    border-radius: var(--auth-radius);
    background: var(--auth-green);
    border: none;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.28);
    transition: background 0.15s ease, transform 0.15s ease;
    cursor: pointer;
}

.auth-btn:hover:not(:disabled),
.verify-btn:hover,
.auth-form-panel .btn-success:hover {
    background: var(--auth-green-dark);
    color: #fff;
    transform: translateY(-1px);
}

.auth-btn:focus-visible,
.verify-btn:focus-visible,
.auth-form-panel .btn-success:focus-visible {
    outline: 2px solid var(--auth-green);
    outline-offset: 2px;
}

.auth-btn:disabled {
    background: #d1d5db;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ─── Links & footer ─── */
.bottom-text {
    text-align: center;
    margin-top: 22px;
    color: var(--auth-muted);
    font-size: 13px;
    font-weight: 600;
}

.bottom-text a,
.auth-forgot-link {
    text-decoration: none;
    color: var(--auth-green);
    font-weight: 800;
}

.bottom-text a:hover,
.auth-forgot-link:hover {
    color: var(--auth-green-dark);
}

.auth-forgot-wrap {
    text-align: right;
    margin-top: 12px;
}

/* ─── OTP ─── */
.otp-input {
    height: 56px;
    border-radius: var(--auth-radius);
    text-align: center;
    font-size: 22px;
    letter-spacing: 10px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* ─── Errors ─── */
.errorlist {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: var(--auth-radius);
    padding: 12px 14px;
    margin-bottom: 14px;
    list-style: none;
    font-size: 13px;
    font-weight: 700;
}

.auth-form-panel .form-control.is-invalid,
.field-error {
    border-color: #dc2626;
}

/* Forgot/reset simple forms spacing */
.auth-simple-form .form-control {
    margin-bottom: 14px;
}

.auth-simple-form .form-control:last-of-type {
    margin-bottom: 20px;
}

/* ─── Responsive ─── */
@media (max-width: 820px) {
    .auth-shell {
        grid-template-columns: 1fr;
        max-width: 440px;
    }

    .auth-brand-panel {
        padding: 24px 22px;
    }

    .auth-brand-list {
        display: none;
    }

    .auth-form-panel {
        padding: 28px 22px 32px;
    }
}

@media (max-width: 520px) {
    .auth-wrapper,
    .otp-wrapper {
        padding: 12px 12px 32px;
        align-items: flex-start;
    }

    .auth-shell {
        border-radius: var(--auth-radius-lg);
    }

    .auth-brand-panel {
        padding: 20px 18px;
    }

    .auth-brand-panel h2 {
        font-size: 20px;
    }

    .auth-form-panel {
        padding: 22px 18px 26px;
    }

    .auth-card .form-control,
    .auth-form-panel .form-control,
    .otp-card .form-control {
        height: 50px;
        font-size: 16px; /* prevents iOS zoom */
    }

    .auth-btn,
    .verify-btn,
    .auth-form-panel .btn-success {
        min-height: 52px;
        font-size: 16px;
    }

    .otp-input {
        font-size: 20px;
        letter-spacing: 8px;
    }

    .password-hint {
        padding: 12px;
    }
}

@media (min-width: 1440px) {
    .auth-shell {
        max-width: 1000px;
        grid-template-columns: minmax(0, 1.1fr) minmax(360px, 480px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-btn,
    .verify-btn,
    .auth-form-panel .btn-success,
    .strength-fill {
        transition: none;
    }

    .auth-btn:hover:not(:disabled),
    .verify-btn:hover,
    .auth-form-panel .btn-success:hover {
        transform: none;
    }
}
