@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
    --primary: #1a1a1a;
    --secondary: #3d6df2;
    --background: rgba(255, 255, 255, 0.95);
    --text: #1f1f1f;
    --border: #e0e0e0;
    --shadow: 0px 8px 30px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    position: relative;
    overflow: hidden;
    padding: 1rem;
}

/* Enhanced Geometric Background */
.geometric-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.gradient-blob {
    position: absolute;
    filter: blur(70px);
    opacity: 0.4;
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
    mix-blend-mode: multiply;
}

.blob-1 {
    width: 800px;
    height: 800px;
    background: linear-gradient(135deg, #4338CA 0%, #6366F1 100%);
    top: 10%;
    left: -10%;
    animation-delay: 0s;
    animation-duration: 25s;
}

.blob-2 {
    width: 700px;
    height: 700px;
    background: linear-gradient(45deg, #059669 0%, #34D399 100%);
    top: 50%;
    right: -15%;
    animation-delay: 5s;
    animation-duration: 30s;
}

.blob-3 {
    width: 600px;
    height: 600px;
    background: linear-gradient(225deg, #7C3AED 0%, #A78BFA 100%);
    bottom: -10%;
    left: 20%;
    animation-delay: 10s;
    animation-duration: 35s;
}

.blob-4 {
    width: 500px;
    height: 500px;
    background: linear-gradient(300deg, #DC2626 0%, #F87171 100%);
    top: 20%;
    right: 30%;
    animation-delay: 15s;
    animation-duration: 40s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    25% {
        transform: translate(20px, 30px) rotate(90deg) scale(1.05);
    }
    50% {
        transform: translate(40px, 10px) rotate(180deg) scale(1.1);
    }
    75% {
        transform: translate(20px, -20px) rotate(270deg) scale(1.05);
    }
    100% {
        transform: translate(0, 0) rotate(360deg) scale(1);
    }
}

.brand-logo {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    width: 100px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    z-index: 10;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--background);
    padding: 2rem 1.5rem;
    border-radius: 18px;
    box-shadow: var(--shadow);
    animation: fade .3s ease-out;
    text-align: center;
    backdrop-filter: blur(10px);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

@keyframes fade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.logo { 
    width: 42px; 
    margin-bottom: 10px; 
    opacity: 0.85; 
}

.form-title { 
    font-size: 1.5rem; 
    font-weight: 600; 
    margin: 8px 0 20px; 
    color: var(--text); 
}

.auth-form {
    width: 100%;
    display: none;
}

.auth-form.active {
    display: block;
}

.input-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

.input-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-weight: 500;
    font-size: 0.875rem;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 16px;
    box-sizing: border-box;
    transition: .2s;
    background: #fff;
}

.input-field:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(61,109,242,0.15);
    outline: none;
}

.submit-btn {
    margin-top: 16px;
    width: 100%;
    padding: 16px;
    border-radius: 10px;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: .2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.submit-btn:hover, .submit-btn:active { 
    background: #000; 
    transform: translateY(-2px);
}

.divider {
    margin: 24px 0;
    font-size: 14px;
    color: #666;
    position: relative;
}

.divider:before, .divider:after {
    content: "";
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #ddd;
}
.divider:before { left: 0; }
.divider:after { right: 0; }

.social-auth {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-btn {
    width: 100%;
    padding: 14px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: .2s;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.social-btn:hover, .social-btn:active { 
    background: #f9f9f9; 
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.forgot-password {
    margin-top: 12px;
    font-size: 14px;
    color: var(--secondary);
    cursor: pointer;
    display: inline-block;
    text-align: right;
    width: 100%;
    padding: 8px 0;
    transition: .2s;
}
.forgot-password:hover, .forgot-password:active { 
    text-decoration: underline; 
    color: #2954d0;
}

.bottom-text { 
    margin-top: 24px; 
    font-size: 15px; 
}
.bottom-text a { 
    color: var(--secondary); 
    text-decoration: none; 
    cursor: pointer; 
    font-weight: 500;
    transition: .2s;
}
.bottom-text a:hover, .bottom-text a:active { 
    text-decoration: underline; 
    color: #2954d0;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    font-size: 0.8rem;
    margin-top: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 4px 0;
}

.footer-links a:hover {
    color: var(--secondary);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    z-index: 1000;
    padding: 1rem;
}

.reset-modal {
    background: #fff;
    padding: 24px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.modal-title {
    margin-top: 0; 
    font-size: 1.4rem; 
    margin-bottom: 1rem;
}

.reset-modal p { 
    font-size: 15px; 
    color: #555; 
    margin-bottom: 16px; 
    line-height: 1.5;
}

.reset-modal input {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 16px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 16px;
    box-sizing: border-box;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    transition: .2s;
    flex: 1;
}

.cancel-btn { 
    background: #f0f0f0; 
    color: #333; 
}

.send-btn { 
    background: var(--primary); 
    color: #fff; 
}

.modal-btn:hover, .modal-btn:active { 
    opacity: 0.9; 
    transform: translateY(-2px);
}

.error-message {
    color: #e11d48;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    min-height: 1.2rem;
}

.success-message {
    color: #10b981;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    min-height: 1.2rem;
}

/* Mobile Styles */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: 5rem;
    }
    
    .auth-card {
        max-width: 100%;
        padding: 1.5rem 1.2rem;
        margin-top: 0;
    }
    
    .brand-logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        top: 1rem;
        width: 90px;
    }
    
    /* Adjust blob sizes for mobile */
    .blob-1 {
        width: 400px;
        height: 400px;
        top: 5%;
        left: -30%;
    }
    
    .blob-2 {
        width: 350px;
        height: 350px;
        top: 50%;
        right: -30%;
    }
    
    .blob-3 {
        width: 300px;
        height: 300px;
        bottom: -5%;
        left: 10%;
    }
    
    .blob-4 {
        width: 250px;
        height: 250px;
        top: 15%;
        right: 15%;
    }
    
    .reset-modal {
        width: 90%;
        max-width: 350px;
        padding: 20px;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-btn {
        width: 100%;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    body {
        padding-top: 4rem;
    }
    
    .auth-card {
        padding: 1.2rem 1rem;
    }
    
    .form-title {
        font-size: 1.3rem;
    }
    
    .input-field, .submit-btn, .social-btn {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .footer-links {
        gap: 1rem;
        font-size: 0.75rem;
    }
    
    .blob-1, .blob-2, .blob-3, .blob-4 {
        opacity: 0.3;
    }
    
    .brand-logo {
        width: 80px;
    }
}

/* Very small devices */
@media (max-width: 360px) {
    .auth-card {
        padding: 1rem 0.8rem;
    }
    
    .form-title {
        font-size: 1.2rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }
}