/* ═══════════════════════════════════════════════════════════════
   user-auth.css  — Login / Register page (uses site header/footer)
   No inline styles allowed. All rules go here.
   Colors use CSS variables defined by AppearanceSettings.
═══════════════════════════════════════════════════════════════ */

/* ── Section wrapper ─────────────────────────────────────────── */
.auth-section {
    padding: 3rem 0;
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
}

.auth-wrap {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
}

/* ── Card ──────────────────────────────────────────────────────── */
.auth-card {
    width: 100%;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.10);
    overflow: hidden;
}

/* ── Tabs ──────────────────────────────────────────────────────── */
.auth-tabs {
    display: flex;
    border-bottom: 2px solid #f0e8e8;
}

.auth-tab {
    flex: 1;
    padding: 1rem;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #999;
    cursor: pointer;
    transition: color 0.2s, border-bottom-color 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.auth-tab:hover {
    color: var(--primary-color);
}

.auth-tab--active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* ── Alerts ─────────────────────────────────────────────────────── */
.auth-alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-alert--error {
    background: #fff0f3;
    color: #c0392b;
    border-bottom: 1px solid #fad7d7;
}

.auth-alert--success {
    background: #f0fdf4;
    color: #166534;
    border-bottom: 1px solid #bbf7d0;
}

/* ── Panel ──────────────────────────────────────────────────────── */
.auth-panel {
    display: none;
    padding: 1.75rem 2rem 2rem;
}

.auth-panel--active {
    display: block;
}

/* ── Google Button ──────────────────────────────────────────────── */
.auth-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #dadce0;
    border-radius: 10px;
    background: #fff;
    color: #3c4043;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s, border-color 0.18s;
    position: relative;
}

.auth-google-btn:hover {
    background: #f8f9fa;
    border-color: #c0c4c8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.auth-google-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Featured badge on Google button */
.auth-google-badge {
    position: absolute;
    top: -11px;
    inset-inline-end: 4px;
    background: #000;
    color: #fff;
    font-size: 0.63rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

/* ── Divider ─────────────────────────────────────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0 1rem;
    color: #aaa;
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e8e0e0;
}

/* ── Form fields ─────────────────────────────────────────────────── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.auth-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
}

.auth-required {
    color: var(--primary-color);
    margin-inline-start: 2px;
}

.auth-input {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid #e0d8d8;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.93rem;
    color: #2d2d2d;
    background: #fafafa;
    transition: border-color 0.18s, box-shadow 0.18s;
    outline: none;
}

.auth-input:focus {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.07);
}

/* Password field wrapper */
.auth-input-wrap {
    position: relative;
    width: 100%;
}

.auth-input-wrap .auth-input {
    width: 100%;
    padding-inline-end: 2.8rem;
}

.auth-eye-btn {
    position: absolute;
    inset-inline-end: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    display: flex;
    align-items: center;
    padding: 0;
    transition: color 0.18s;
}

.auth-eye-btn:hover {
    color: #555;
}

/* hide the "crossed" eye by default; JS toggles on click */
.auth-eye-hide {
    display: none;
}

.auth-hint {
    font-size: 0.75rem;
    color: #aaa;
}

/* ── Submit Button ───────────────────────────────────────────────── */
.auth-submit-btn {
    width: 100%;
    padding: 0.8rem;
    margin-top: 0.25rem;
    background: var(--button-color, var(--primary-color));
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.18s, box-shadow 0.18s;
    letter-spacing: 0.01em;
}

.auth-submit-btn:hover {
    opacity: 0.88;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.20);
}

.auth-submit-btn:active {
    opacity: 0.85;
}

/* ── Switch link ─────────────────────────────────────────────────── */
.auth-switch {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: #777;
}

.auth-switch-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    margin-inline-start: 4px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-switch-btn:hover {
    opacity: 0.75;
}

/* ── RTL adjustments ─────────────────────────────────────────────── */
[dir="rtl"] .auth-tab {
    font-size: 0.98rem;
}

[dir="rtl"] .auth-google-btn {
    font-size: 0.95rem;
}

/* ── Phone field (intl-tel-input v26+) ────────────────────────────── */
.auth-phone-wrap {
    direction: ltr;
}

.auth-phone-wrap .iti {
    width: 100%;
    display: block;
}

.auth-phone-wrap .iti input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid #e0d8d8;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.93rem;
    color: #2d2d2d;
    background: #fafafa;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.auth-phone-wrap .iti input:focus {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.07);
}

.auth-phone-error {
    font-size: 0.75rem;
    color: #c0392b;
    margin-top: 3px;
    display: none;
}

/* ── Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .auth-section {
        padding: 1.5rem 0;
    }

    .auth-panel {
        padding: 1.25rem 1.25rem 1.5rem;
    }

    .auth-card {
        border-radius: 14px;
    }
}
