/* ======================================================
   Sarekam CSS — auth-screen.css  (v2 — Premium Redesign)
   Login / Sign Up overlay with inline OTP reveal
   ====================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── Backdrop ───────────────────────────────────────────────── */
.auth-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(10, 10, 20, 0.65);
    z-index: 3000;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.auth-backdrop.active { display: block; }

/* ── Overlay Container ──────────────────────────────────────── */
.auth-view {
    display: none;
    position: fixed; inset: 0;
    z-index: 3001;
    justify-content: center;
    align-items: center;
    padding: 16px;
}
.auth-view.active {
    display: flex;
    animation: authPopIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes authPopIn {
    from { opacity: 0; transform: scale(0.88) translateY(16px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Panel Card ─────────────────────────────────────────────── */
.auth-panel {
    background: #ffffff;
    width: 100%;
    max-width: 400px;
    border-radius: 32px;
    overflow: hidden;
    position: relative;
    box-shadow:
        0 4px 6px rgba(0,0,0,0.04),
        0 20px 48px rgba(99,102,241,0.18),
        0 48px 80px rgba(0,0,0,0.12);
    padding-bottom: 28px;
    font-family: 'Inter', sans-serif;
}

/* ── Close Button ───────────────────────────────────────────── */
.auth-close-btn {
    position: absolute; top: 16px; right: 16px;
    background: #f3f4f6;
    border: none;
    width: 34px; height: 34px;
    border-radius: 50%;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, color 0.2s;
    z-index: 10;
}
.auth-close-btn:hover { background: #e5e7eb; color: #111; }

/* ── Gradient Avatar ────────────────────────────────────────── */
.auth-avatar {
    width: 82px; height: 82px;
    background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
    border-radius: 50%;
    margin: 32px auto 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 2rem;
    box-shadow:
        0 8px 24px rgba(99,102,241,0.4),
        0 2px 8px rgba(168,85,247,0.3);
    position: relative;
}
.auth-avatar::after {
    content: '';
    position: absolute; inset: -3px;
    border-radius: 50%;
    border: 2px solid rgba(99,102,241,0.2);
}

/* ── Tab Switcher ───────────────────────────────────────────── */
.auth-tabs {
    display: flex;
    gap: 4px;
    margin: 22px 24px 0;
    background: #f3f4f6;
    border-radius: 16px;
    padding: 5px;
}
.auth-tab {
    flex: 1;
    padding: 10px 0;
    background: transparent;
    border: none;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.22s ease;
    letter-spacing: -0.01em;
}
.auth-tab.active {
    background: #fff;
    color: #1f2937;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

/* ── Content & Form ─────────────────────────────────────────── */
.auth-content { padding: 0 24px; }
.auth-form    { margin-top: 20px; }

/* ── Field ──────────────────────────────────────────────────── */
.auth-field { margin-bottom: 14px; }

.auth-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.auth-required { color: #ef4444; margin-left: 2px; }

.auth-input-wrap { position: relative; }

.auth-field-icon {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 14px;
    pointer-events: none;
    transition: color 0.2s;
}

.auth-field input {
    width: 100%;
    padding: 13px 14px 13px 40px;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #111827;
    background: #f9fafb;
    outline: none;
    transition: all 0.22s ease;
    box-sizing: border-box;
}
.auth-field input::placeholder { color: #9ca3af; font-weight: 400; }
.auth-field input:focus {
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.auth-field input:focus + .auth-field-icon,
.auth-field input:focus ~ .auth-field-icon { color: #6366f1; }
.auth-field:focus-within .auth-field-icon { color: #6366f1; }

/* ── Primary Button ─────────────────────────────────────────── */
.auth-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: #fff;
    border: none;
    border-radius: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: pointer;
    margin-top: 6px;
    box-shadow: 0 6px 20px rgba(99,102,241,0.38);
    transition: all 0.22s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}
.auth-submit-btn::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    opacity: 0;
    transition: opacity 0.22s;
}
.auth-submit-btn:hover::before   { opacity: 1; }
.auth-submit-btn:hover           { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(99,102,241,0.42); }
.auth-submit-btn:active          { transform: scale(0.98); opacity: 0.9; }
.auth-submit-btn:disabled        { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.auth-submit-btn .auth-btn-text  { position: relative; }
.auth-submit-btn .auth-spinner   { position: relative; }

/* Register variant — slightly different gradient */
.auth-register-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    box-shadow: 0 6px 20px rgba(139,92,246,0.35);
}
.auth-register-btn::before {
    background: linear-gradient(135deg, #a78bfa 0%, #f472b6 100%);
}
.auth-register-btn:hover { box-shadow: 0 10px 28px rgba(139,92,246,0.42); }

/* ── Switch Text ────────────────────────────────────────────── */
.auth-switch-text {
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
    margin: 18px 0 0;
    font-weight: 500;
}
.auth-switch-text span {
    color: #6366f1;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.18s;
}
.auth-switch-text span:hover { color: #4f46e5; text-decoration: underline; }

/* ── Inline OTP Section ─────────────────────────────────────── */
.auth-inline-otp {
    animation: authSlideDown 0.36s cubic-bezier(0.34, 1.3, 0.64, 1);
    transform-origin: top center;
}
@keyframes authSlideDown {
    from { opacity: 0; transform: translateY(-12px) scaleY(0.9); }
    to   { opacity: 1; transform: translateY(0) scaleY(1); }
}

/* OTP sent confirmation chip */
.auth-otp-sent-label {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #15803d;
    margin: 16px 0 20px;
}
.auth-otp-sent-label i { color: #22c55e; font-size: 15px; flex-shrink: 0; }
.auth-otp-sent-label strong { color: #166534; }

/* ── OTP Boxes ──────────────────────────────────────────────── */
.auth-otp-boxes {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}
.auth-otp-box {
    width: 60px;
    height: 64px;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 26px;
    font-weight: 900;
    color: #6366f1;
    text-align: center;
    background: #f9fafb;
    outline: none;
    transition: all 0.2s ease;
    caret-color: transparent;
}
.auth-otp-box:focus {
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
    transform: scale(1.04);
}
.auth-otp-box.filled {
    border-color: #a855f7;
    background: #faf5ff;
    color: #7c3aed;
}

/* ── Resend Row ─────────────────────────────────────────────── */
.auth-resend {
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
    margin: 12px 0 4px;
    font-weight: 500;
}
.auth-resend strong { color: #6b7280; }
#authResendBtn,
#authRegResendBtn {
    background: none;
    border: none;
    color: #6366f1;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 0;
}
#authResendBtn:hover,
#authRegResendBtn:hover { color: #4f46e5; }

/* ── Back Link ──────────────────────────────────────────────── */
.auth-back-link {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    background: none;
    border: none;
    color: #9ca3af;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin: 10px auto 0;
    transition: color 0.18s;
    padding: 4px 8px;
    border-radius: 8px;
}
.auth-back-link:hover { color: #4b5563; background: #f3f4f6; }
.auth-back-link i { font-size: 11px; }

/* ── Status / Error Message ─────────────────────────────────── */
.auth-msg {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    min-height: 20px;
    margin: 12px 0 0;
    color: #ef4444;
    border-radius: 8px;
    transition: all 0.2s;
}
.auth-msg.success { color: #16a34a; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 420px) {
    .auth-panel     { border-radius: 24px; max-width: 100%; }
    .auth-content   { padding: 0 18px; }
    .auth-avatar    { width: 70px; height: 70px; font-size: 1.7rem; }
    .auth-otp-box   { width: 54px; height: 58px; font-size: 22px; border-radius: 12px; }
    .auth-tabs      { margin: 18px 18px 0; }
}
