/* ============================================================
   AYURCALL — auth.css
   Login / OTP page only. Loaded via @section Styles.
   Standalone — does not depend on cart.css.
   ============================================================ */

/* ── Page wrapper ── */
/* Item 4 — reduced top padding; card anchors near top on mobile */
.auth-page {
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4) var(--space-4);   /* was space-8 — halved */
    background: var(--color-bg);
}

[hidden] {
    display: none !important;
}
/* ── Card ── */
.auth-card {
    background: var(--color-surface);
    border: 0.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Top: logo + heading ── */
.auth-top {
    text-align: center;
    margin-bottom: 2rem;
}

/* Item 1 — green background removed; logo displays on page background */
.auth-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.auth-title {
    font-size: var(--font-size-section);
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.auth-subtitle {
    font-size: var(--font-size-small);
    color: var(--color-text-secondary);
    line-height: 1.6;
    max-width: 300px;
    margin: 0 auto;
}

/* ── Error box ── */
.auth-error-box {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: #FEF2F2;
    color: #DC2626;
    border: 0.5px solid #FECACA;
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-small);
    margin-bottom: 1.5rem;
}

.auth-error-box i { font-size: 16px; flex-shrink: 0; }

/* ── Step container ── */
.auth-step {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Field ── */
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-label {
    font-size: var(--font-size-micro);
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* ── Phone input ── */
.phone-field {
    display: flex;
    border: 0.5px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--transition);
}

.phone-field:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(29,122,120,0.1);
}

.phone-field__prefix {
    padding: 0 var(--space-4);
    background: var(--color-bg);
    border-right: 0.5px solid var(--color-border);
    font-size: var(--font-size-body);
    font-weight: 500;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.phone-field__input {
    flex: 1;
    height: 48px;
    padding: 0 var(--space-4);
    border: none;
    outline: none;
    font-size: 16px;         /* Item 5 — was 15px; must be ≥16px to prevent iOS Safari zoom */
    font-family: inherit;
    color: var(--color-text-primary);
    background: transparent;
}

/* ── Generic text input ── */
.auth-input {
    width: 100%;
    height: 48px;
    padding: 0 var(--space-4);
    border: 0.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-body);
    font-family: inherit;
    color: var(--color-text-primary);
    outline: none;
    transition: border-color var(--transition);
    background: var(--color-surface);
}

.auth-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(29,122,120,0.1);
}

/* ── OTP input ── */
.otp-input {
    width: 100%;
    height: 60px;
    padding: 0 var(--space-4);
    border: 0.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 10px;
    outline: none;
    font-family: inherit;
    color: var(--color-text-primary);
    background: var(--color-surface);
    transition: border-color var(--transition);
}

.otp-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(29,122,120,0.1);
}

/* ── Error + hint text ── */
.auth-field-error {
    font-size: var(--font-size-micro);
    color: #DC2626;
    display: flex;
    align-items: center;
    gap: 4px;
}

.auth-field-hint {
    font-size: var(--font-size-micro);
    color: var(--color-text-muted);
}

/* ── Primary button ── */
.btn--auth-primary {
    width: 100%;
    height: 50px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-body);
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn--auth-primary:hover   { background: var(--color-primary-dark); }
.btn--auth-primary:disabled {
    background: var(--color-border);
    color: var(--color-text-muted);
    cursor: not-allowed;
}

/* ── Divider ── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

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

.auth-divider span {
    font-size: var(--font-size-micro);
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* ── Trust badges ── */
.auth-trust-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
}

.auth-trust-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: var(--space-3) var(--space-2);
    background: var(--color-primary-light);
    border-radius: var(--radius-md);
}

.auth-trust-item i    { font-size: 18px; color: var(--color-primary); }
.auth-trust-item span { font-size: var(--font-size-micro); color: var(--color-text-secondary); text-align: center; line-height: 1.3; }

/* ── OTP sent notice ── */
.otp-sent-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    background: var(--color-primary-light);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
}

.otp-sent-notice__text {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-small);
    color: var(--color-text-secondary);
    min-width: 0; /* allows flex shrinking below content size */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.otp-sent-notice__text span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.otp-sent-notice__text i { font-size: 16px; color: var(--color-primary); flex-shrink: 0; }

.otp-change-phone {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: var(--font-size-small);
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
    font-weight: 500;
    flex-shrink: 0;
}

.otp-change-phone:hover { text-decoration: underline; }

/* ── Channel status ── */
.auth-channel-status {
    font-size: var(--font-size-micro);
    color: var(--color-text-secondary);
    background: var(--color-primary-light);
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-3);
    line-height: 1.5;
}

/* ── Resend row ── */
.resend-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.resend-btn {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: var(--font-size-small);
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    font-weight: 500;
}

.resend-btn:hover:not(:disabled)  { text-decoration: underline; }
.resend-btn:disabled               { color: var(--color-text-muted); cursor: not-allowed; }

.resend-timer {
    font-size: var(--font-size-micro);
    color: var(--color-text-muted);
}

/* ── Legal footer ── */
.auth-legal {
    margin-top: 1.5rem;
    text-align: center;
    font-size: var(--font-size-micro);
    color: var(--color-text-muted);
    line-height: 1.6;
}

.auth-legal a {
    color: var(--color-primary);
    text-decoration: none;
}

.auth-legal a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 480px) {
    /* Item 4 — card anchors to top on small screens, not vertically centred */
    .auth-page       { align-items: flex-start; padding-top: var(--space-3); }
    .auth-card       { padding: 2rem 1.25rem; }
    .auth-trust-row  { gap: var(--space-1); }
    .auth-trust-item { padding: var(--space-2) var(--space-1); }

    /* "OTP sent to <phone>" gets the full width on one line; "Change number" drops below */
    .otp-sent-notice { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
    .otp-sent-notice__text,
    .otp-sent-notice__text span { overflow: visible; text-overflow: clip; }
}
