/* ═══════════════════════════════════════════════════════════════
   DRISHTI — Auth Screen Styles (Sign Up / Sign In + OTP)
   Premium light glassmorphism design with smooth animations
   ═══════════════════════════════════════════════════════════════ */

/* ── Auth Overlay ─────────────────────────────────────────────── */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecf8 25%, #f5f0ff 50%, #eef2ff 75%, #f8faff 100%);
    background-size: 400% 400%;
    animation: authGradientShift 15s ease infinite;
    overflow-y: auto;
    padding: 20px;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.02);
}

.auth-overlay::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 50%, rgba(59, 130, 246, 0.03) 0%, transparent 60%);
    pointer-events: none;
    animation: authOrbFloat 20s ease-in-out infinite;
}

@keyframes authGradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes authOrbFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -20px) rotate(5deg); }
    66% { transform: translate(-20px, 15px) rotate(-3deg); }
}

/* ── Decorative Floating Shapes ───────────────────────────────── */
.auth-bg-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.auth-bg-shapes .shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.07;
    filter: blur(1px);
}

.auth-bg-shapes .shape:nth-child(1) {
    width: 300px; height: 300px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    top: -80px; right: -60px;
    animation: shapeFloat1 18s ease-in-out infinite;
}
.auth-bg-shapes .shape:nth-child(2) {
    width: 200px; height: 200px;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    bottom: -40px; left: -50px;
    animation: shapeFloat2 22s ease-in-out infinite;
}
.auth-bg-shapes .shape:nth-child(3) {
    width: 150px; height: 150px;
    background: linear-gradient(135deg, #a78bfa, #c084fc);
    top: 40%; left: 10%;
    animation: shapeFloat3 16s ease-in-out infinite;
}
.auth-bg-shapes .shape:nth-child(4) {
    width: 100px; height: 100px;
    background: linear-gradient(135deg, #60a5fa, #818cf8);
    top: 20%; right: 15%;
    animation: shapeFloat1 20s ease-in-out infinite reverse;
}

@keyframes shapeFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-25px, 30px) scale(1.08); }
}
@keyframes shapeFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -25px) scale(1.05); }
}
@keyframes shapeFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(15px, 20px) scale(1.1); }
}

/* ── Auth Card (Main Container) ───────────────────────────────── */
.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    padding: 0;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.03),
        0 10px 15px -3px rgba(0, 0, 0, 0.05),
        0 20px 40px -8px rgba(99, 102, 241, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    animation: authCardEnter 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
    overflow: hidden;
}

@keyframes authCardEnter {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Auth Card Header / Branding ──────────────────────────────── */
.auth-header {
    text-align: center;
    padding: 36px 32px 8px;
}

.auth-logo-simple {
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

@keyframes logoRingPulse {
    0%, 100% { box-shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.35); }
    50% { box-shadow: 0 8px 32px -2px rgba(99, 102, 241, 0.5); }
}

.auth-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e1b4b;
    letter-spacing: -0.02em;
    margin: 0 0 4px;
}

.auth-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 400;
    margin: 0;
    line-height: 1.5;
}

/* ── Tab Switcher (Sign Up / Sign In) ─────────────────────────── */
.auth-tabs {
    display: flex;
    margin: 20px 32px 0;
    background: #f1f5f9;
    border-radius: 14px;
    padding: 4px;
    position: relative;
}

.auth-tab {
    flex: 1;
    padding: 10px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    background: none;
    border: none;
    border-radius: 11px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.auth-tab.active {
    color: #4f46e5;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(99, 102, 241, 0.08);
}

.auth-tab:not(.active):hover {
    color: #374151;
}

/* ── Auth Body / Forms ────────────────────────────────────────── */
.auth-body {
    padding: 24px 32px 32px;
}

.auth-form {
    display: none;
    animation: authFormFadeIn 0.4s ease both;
}

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

@keyframes authFormFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Form Field Groups ────────────────────────────────────────── */
.auth-field {
    margin-bottom: 18px;
}

.auth-field-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    font-size: 1.1rem;
    color: #9ca3af;
    pointer-events: none;
    transition: color 0.3s ease;
    z-index: 1;
}

.auth-input {
    width: 100%;
    padding: 13px 14px 13px 44px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1f2937;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-input::placeholder {
    color: #b0b8c4;
    font-weight: 400;
}

.auth-input:focus {
    border-color: #818cf8;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.08), 0 1px 3px rgba(99, 102, 241, 0.1);
}

.auth-input:focus + .auth-input-icon,
.auth-input:focus ~ .auth-input-icon {
    color: #6366f1;
}

.auth-input-wrap:focus-within .auth-input-icon {
    color: #6366f1;
}

.auth-field-error {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: 4px;
    display: none;
    animation: fieldErrorSlide 0.3s ease;
}

.auth-field-error.visible {
    display: block;
}

@keyframes fieldErrorSlide {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Phone Input with Country Code ────────────────────────────── */
.auth-phone-group {
    display: flex;
    gap: 8px;
}

.auth-phone-prefix {
    width: 72px;
    flex-shrink: 0;
    padding: 13px 8px 13px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #4f46e5;
    background: #eef2ff;
    border: 1.5px solid #c7d2fe;
    border-radius: 14px;
    text-align: center;
    outline: none;
    cursor: default;
}

.auth-phone-input {
    flex: 1;
    padding: 13px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1f2937;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.5px;
}

.auth-phone-input::placeholder {
    color: #b0b8c4;
    font-weight: 400;
    letter-spacing: 0;
}

.auth-phone-input:focus {
    border-color: #818cf8;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.08), 0 1px 3px rgba(99, 102, 241, 0.1);
}

/* ── Primary Auth Button ──────────────────────────────────────── */
.auth-btn-primary {
    width: 100%;
    padding: 14px 24px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px -2px rgba(99, 102, 241, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}

.auth-btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #4f46e5 0%, #6d28d9 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px -2px rgba(99, 102, 241, 0.5);
}

.auth-btn-primary:hover::before {
    opacity: 1;
}

.auth-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px -2px rgba(99, 102, 241, 0.4);
}

.auth-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-btn-primary span {
    position: relative;
    z-index: 1;
}

.auth-btn-primary .btn-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpinner 0.7s linear infinite;
    position: relative;
    z-index: 1;
}

.auth-btn-primary.loading .btn-spinner {
    display: block;
}

.auth-btn-primary.loading span:not(.btn-spinner) {
    display: none;
}

@keyframes authSpinner {
    to { transform: rotate(360deg); }
}

/* ── OTP Screen ───────────────────────────────────────────────── */
.auth-otp-screen {
    display: none;
    animation: authFormFadeIn 0.5s ease both;
}

.auth-otp-screen.active {
    display: block;
}

.otp-header {
    text-align: center;
    margin-bottom: 28px;
}

.otp-icon-ring {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ddd6fe, #e0e7ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    animation: otpIconBounce 2s ease-in-out infinite;
}

@keyframes otpIconBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.otp-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e1b4b;
    margin: 0 0 6px;
}

.otp-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.otp-desc strong {
    color: #4f46e5;
    font-weight: 600;
}

/* ── OTP Input Boxes ──────────────────────────────────────────── */
.otp-input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
}

.otp-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e1b4b;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    outline: none;
    caret-color: #6366f1;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.otp-digit:focus {
    border-color: #818cf8;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), 0 2px 8px rgba(99, 102, 241, 0.15);
    transform: translateY(-2px);
}

.otp-digit.filled {
    border-color: #6366f1;
    background: #eef2ff;
    color: #4f46e5;
}

.otp-digit.error {
    border-color: #ef4444;
    background: #fef2f2;
    animation: otpShake 0.4s ease;
}

@keyframes otpShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.otp-error-msg {
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #ef4444;
    margin-bottom: 16px;
    display: none;
}

.otp-error-msg.visible {
    display: block;
    animation: fieldErrorSlide 0.3s ease;
}

/* ── OTP Resend / Timer ───────────────────────────────────────── */
.otp-actions {
    text-align: center;
    margin-top: 20px;
}

.otp-resend-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #9ca3af;
}

.otp-resend-btn {
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6366f1;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.otp-resend-btn:disabled {
    color: #c7c7c7;
    cursor: not-allowed;
    text-decoration: none;
}

.otp-timer {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #9ca3af;
    font-weight: 500;
}

.otp-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    margin-top: 12px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.otp-back-btn:hover {
    background: #f1f5f9;
    color: #374151;
}

/* ── Success Screen ───────────────────────────────────────────── */
.auth-success-screen {
    display: none;
    text-align: center;
    padding: 20px 0;
    animation: authFormFadeIn 0.5s ease both;
}

.auth-success-screen.active {
    display: block;
}

.success-checkmark-ring {
    width: 88px;
    height: 88px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px -4px rgba(34, 197, 94, 0.4);
    animation: successPop 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.success-checkmark-ring svg {
    width: 40px;
    height: 40px;
    stroke: #fff;
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.success-checkmark-ring svg polyline {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: checkDraw 0.5s ease 0.4s forwards;
}

@keyframes successPop {
    from { transform: scale(0.3); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes checkDraw {
    to { stroke-dashoffset: 0; }
}

.success-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: #166534;
    margin: 0 0 8px;
}

.success-message {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 8px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.success-email-note {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    color: #4f46e5;
    font-weight: 600;
    background: #eef2ff;
    display: inline-block;
    padding: 8px 18px;
    border-radius: 10px;
    margin-top: 8px;
    border: 1px solid #c7d2fe;
}

.success-redirect {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 20px;
}

.success-redirect .countdown {
    font-weight: 700;
    color: #6366f1;
}

/* ── Confetti particles ───────────────────────────────────────── */
.confetti-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    opacity: 0;
    animation: confettiFall 2.5s ease forwards;
}

@keyframes confettiFall {
    0% { opacity: 1; transform: translateY(-40px) rotate(0deg) scale(1); }
    100% { opacity: 0; transform: translateY(400px) rotate(720deg) scale(0.3); }
}

/* ── Auth Footer ──────────────────────────────────────────────── */
.auth-footer {
    text-align: center;
    padding: 0 32px 28px;
}

.auth-footer-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #b0b8c4;
    line-height: 1.5;
}

.auth-footer-text a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 480px) {
    .auth-overlay {
        padding: 12px;
        align-items: flex-start;
        padding-top: 40px;
    }

    .auth-card {
        border-radius: 20px;
        max-width: 100%;
    }

    .auth-header {
        padding: 28px 24px 6px;
    }

    .auth-tabs {
        margin: 16px 24px 0;
    }

    .auth-body {
        padding: 20px 24px 28px;
    }

    .auth-footer {
        padding: 0 24px 24px;
    }

    .auth-logo-ring {
        width: 60px;
        height: 60px;
    }

    .auth-title {
        font-size: 1.3rem;
    }

    .otp-digit {
        width: 42px;
        height: 50px;
        font-size: 1.2rem;
    }

    .otp-input-group {
        gap: 8px;
    }
}

/* ── WhatsApp Badge ───────────────────────────────────────────── */
.whatsapp-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #16a34a;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 6px 12px;
    margin-top: 12px;
    font-weight: 500;
}

.whatsapp-badge svg {
    width: 16px;
    height: 16px;
    fill: #25d366;
}
