/* ============================================
   Login Page Styles — Premium Glassmorphism
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a3a32 0%, #2d6b5a 40%, #3b665b 60%, #1a3a32 100%);
    background-size: 400% 400%;
    animation: gradientShift 12s ease infinite;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 40px 15px;
}

/* Custom Smooth Scrollbar */
::-webkit-scrollbar {
    width: 7px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
}

::-webkit-scrollbar-thumb {
    background: rgba(46, 204, 113, 0.4);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(46, 204, 113, 0.7);
}

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

/* Animated Background Circles */
.bg-circles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.08;
}

.circle-1 {
    width: 500px;
    height: 500px;
    background: #2ecc71;
    top: -100px;
    right: -100px;
    animation: float1 8s ease-in-out infinite;
}

.circle-2 {
    width: 350px;
    height: 350px;
    background: #27ae60;
    bottom: -50px;
    left: -80px;
    animation: float2 10s ease-in-out infinite;
}

.circle-3 {
    width: 250px;
    height: 250px;
    background: #26de81;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float3 7s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-30px, 40px) scale(1.1); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -30px) scale(1.05); }
}

@keyframes float3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.15); }
}

/* Main Container */
.login-container {
    position: relative;
    z-index: 1;
    width: 90%;
    max-width: 420px;
    margin: auto;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 40px 35px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: containerEntry 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: opacity, transform;
}

@keyframes containerEntry {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Back Button */
.back-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    z-index: 10;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.back-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
}

/* Logo Section */
.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    margin-bottom: 15px;
    transition: transform 0.4s ease;
}

.login-logo:hover {
    transform: scale(1.1) rotate(5deg);
}

.logo-section h1 {
    color: #ffffff;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-top: 6px;
    font-weight: 400;
}

/* Tab Switcher */
.tab-switcher {
    display: flex;
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 28px;
    gap: 4px;
}

.tab-btn {
    flex: 1;
    padding: 12px 0;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 11px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.tab-btn.active {
    color: #1a3a32;
}

.tab-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 11px;
    transition: transform 0.35s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.tab-indicator.right {
    transform: translateX(100%);
}

/* Auth Forms */
.auth-form {
    display: none;
    flex-direction: column;
    gap: 16px;
    animation: formFadeIn 0.4s ease;
}

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

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

/* Input Wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    font-size: 18px;
    z-index: 2;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 50px 14px 46px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
}

.input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
}

.input-wrapper input:focus {
    border-color: #2ecc71;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.15);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    opacity: 1;
}

/* Toggle Password Button */
.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s;
    z-index: 2;
}

.toggle-password:hover {
    opacity: 1;
}

/* Error Message */
.error-message {
    color: #ff6b6b;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    min-height: 18px;
    transition: all 0.3s ease;
}

.error-message.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

/* Auth Button */
.auth-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.35);
    position: relative;
    overflow: hidden;
}

.auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.auth-btn:hover::before {
    left: 100%;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.45);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.register-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.35);
}

.register-btn:hover {
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.45);
}

/* OAuth Divider */
.oauth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 8px 0;
}

.oauth-divider::before,
.oauth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.oauth-divider span {
    padding: 0 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Google Sign-in Button */
.google-auth-btn {
    width: 100%;
    padding: 13px 18px;
    border: none;
    border-radius: 12px;
    background: #ffffff;
    color: #3c4043;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    user-select: none;
}

.google-auth-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
    color: #202124;
}

.google-auth-btn:active {
    transform: translateY(0);
    background: #f1f3f4;
}

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

/* Success Modal */
.success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.success-content {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px 35px;
    text-align: center;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-icon {
    font-size: 60px;
    margin-bottom: 15px;
    animation: bounce 0.6s ease 0.3s both;
}

@keyframes bounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.success-content h2 {
    color: #2c3e50;
    font-size: 22px;
    margin-bottom: 10px;
}

.success-content p {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 8px;
}

.user-id-display {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    color: #166534;
    font-size: 32px;
    font-weight: 800;
    padding: 18px 25px;
    border-radius: 14px;
    margin: 15px 0;
    letter-spacing: 3px;
    border: 2px dashed #22c55e;
    user-select: all;
    cursor: text;
}

.id-note {
    color: #e67e22 !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    margin-bottom: 20px !important;
}

.success-content .auth-btn {
    margin-top: 5px;
}

/* ========================
   OTP Verification Step
   ======================== */
.otp-step {
    flex-direction: column;
    gap: 16px;
    animation: formFadeIn 0.4s ease;
}

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

.otp-icon {
    font-size: 50px;
    margin-bottom: 10px;
    animation: bounce 0.6s ease 0.2s both;
}

.otp-title {
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.otp-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
}

.otp-subtitle strong {
    color: #2ecc71;
    font-weight: 600;
}

.otp-resend-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.3s ease;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.otp-resend-btn:hover {
    color: #2ecc71;
}

.otp-resend-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Forgot Password Link */
.forgot-password-link {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 10px 0 0 0;
    transition: color 0.3s ease;
    text-decoration: none;
    text-align: center;
    width: 100%;
    display: block;
}

.forgot-password-link:hover {
    color: #2ecc71;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Responsive (Mobile & Android) */
@media (max-width: 480px) {
    body {
        padding: 20px 10px;
    }

    .login-container {
        width: 100%;
        max-width: 400px;
        padding: 28px 18px;
        border-radius: 18px;
    }

    .input-wrapper input {
        font-size: 16px; /* Prevents auto-zoom on mobile/Android Chrome */
        padding: 12px 44px 12px 42px;
    }

    .logo-section h1 {
        font-size: 22px;
    }

    .login-logo {
        width: 60px;
        height: 60px;
    }

    .user-id-display {
        font-size: 24px;
        padding: 12px 16px;
    }

    .otp-title {
        font-size: 18px;
    }

    .otp-icon {
        font-size: 40px;
    }

    .login-btn {
        min-height: 46px;
        font-size: 15px;
        border-radius: 10px;
        -webkit-tap-highlight-color: transparent;
    }

    .auth-tab {
        padding: 10px 8px;
        font-size: 13px;
        -webkit-tap-highlight-color: transparent;
    }
}

@media (max-width: 360px) {
    .login-container {
        padding: 22px 14px;
    }

    .logo-section h1 {
        font-size: 20px;
    }

    .user-id-display {
        font-size: 20px;
    }
}

@media (max-height: 700px) {
    body {
        align-items: flex-start;
        padding-top: 15px;
    }

    .login-container {
        margin-bottom: 20px;
    }
}

