:root {
    --primary: #2a6bcc;
    --primary-light: #e8f0fe;
    --secondary: #4caf50;
    --accent: #2196f3;
    --light: #f8f9fa;
    --dark: #1a1d21;
    --text: #333333;
    --text-light: #6c757d;
    --border: #dee2e6;
    --success: #28a745;
    --warning: #ff9800;
    --danger: #e53935;
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e7f1 100%);
    color: var(--text);
    font-family: 'Candara', 'Montserrat', 'Poppins', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: var(--transition);
}

body.dark-mode {
    background: linear-gradient(135deg, #1a1d21 0%, #23272e 100%);
    color: #e0e0e0;
}

.auth-container {
    width: 100%;
    max-width: 900px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(42, 107, 204, 0.15);
    display: flex;
    min-height: 600px;
    position: relative;
    z-index: 2;
    transform: translateY(0);
    opacity: 1;
    transition: var(--transition);
    animation: fadeInUp 0.8s ease-out;
}

body.dark-mode .auth-container {
    background: var(--dark);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.auth-illustration {
    flex: 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.pulse {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: pulse 3s infinite;
    z-index: 1;
}

.pulse:nth-child(2) {
    animation-delay: 1s;
    width: 250px;
    height: 250px;
}

.pulse:nth-child(3) {
    animation-delay: 2s;
    width: 200px;
    height: 200px;
}

.illustration-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 80%;
}

.illustration-content i {
    font-size: 5rem;
    margin-bottom: 25px;
    color: white;
    animation: float 3s ease-in-out infinite;
}

.illustration-content h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.illustration-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    line-height: 1.6;
}

.features {
    margin-top: 30px;
    text-align: left;
    width: 100%;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    transition: var(--transition);
    transform: translateX(0);
    opacity: 1;
}

.feature-item:nth-child(1) { animation: slideIn 0.5s ease-out; }
.feature-item:nth-child(2) { animation: slideIn 0.7s ease-out; }
.feature-item:nth-child(3) { animation: slideIn 0.9s ease-out; }

.feature-item:hover {
    transform: translateX(10px);
    background: rgba(255, 255, 255, 0.25);
}

.feature-item i {
    font-size: 1.4rem;
    margin-right: 15px;
    margin-bottom: 0;
    width: 30px;
    text-align: center;
    animation: none;
}

.auth-forms {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
    position: relative;
    display: inline-block;
}

.logo h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s ease;
}

.logo h1:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

body.dark-mode .logo h1 {
    color: var(--accent);
}

.logo p {
    font-size: 1.1rem;
    color: var(--text-light);
}

body.dark-mode .logo p {
    color: #a0a0c0;
}

.auth-form {
    display: none;
    animation: fadeIn 0.5s ease forwards;
}

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

.form-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    color: var(--dark);
}

body.dark-mode .form-title {
    color: #f0f0f0;
}

.form-title::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

body.dark-mode .form-title::after {
    background: var(--accent);
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
    transition: var(--transition);
}

body.dark-mode .form-label {
    color: #e0e0e0;
}

.input-group {
    position: relative;
}

.form-control {
    width: 100%;
    padding: 15px 20px 15px 50px;
    background: var(--light);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit !important;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(42, 107, 204, 0.1);
    background: white;
}

body.dark-mode .form-control {
    background: #23272e;
    border-color: #343a40;
    color: #e0e0e0;
}

body.dark-mode .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.2);
    background: #1e2227;
}

.form-control::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

.form-group,
.form-control,
.form-select,
.input-group,
.form-label,
.btn {
    font-family: inherit !important;
}
.input-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 1.2rem;
    z-index: 2;
}

body.dark-mode .input-icon {
    color: var(--accent);
}

.btn {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(42, 107, 204, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(42, 107, 204, 0.4);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(30deg);
    transition: all 0.6s ease;
}

.btn-primary:hover::after {
    transform: rotate(30deg) translate(20%, 20%);
}

.divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: var(--text-light);
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

body.dark-mode .divider::before,
body.dark-mode .divider::after {
    background: #343a40;
}

.divider span {
    padding: 0 15px;
    font-size: 0.9rem;
}

.social-login {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.social-btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    background: white;
    border: 1px solid var(--border);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    font-weight: 500;
}

.social-btn:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

body.dark-mode .social-btn {
    background: #23272e;
    border-color: #343a40;
    color: #e0e0e0;
}

body.dark-mode .social-btn:hover {
    border-color: var(--accent);
}

.auth-footer {
    text-align: center;
    padding: 20px 0 0;
    color: var(--text-light);
    font-size: 0.95rem;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.auth-footer a:hover {
    text-decoration: underline;
    color: var(--accent);
}

body.dark-mode .auth-footer a {
    color: var(--accent);
}

.nav-tabs {
    display: flex;
    list-style: none;
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
}

body.dark-mode .nav-tabs {
    border-color: #343a40;
}

.nav-item {
    flex: 1;
    text-align: center;
}

.nav-link {
    display: block;
    padding: 15px;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

.nav-link.active {
    color: var(--primary);
}

.nav-link.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
}

.nav-link:hover {
    color: var(--primary);
    background: rgba(42, 107, 204, 0.05);
}

body.dark-mode .nav-link {
    color: #a0a0c0;
}

body.dark-mode .nav-link.active {
    color: var(--accent);
}

body.dark-mode .nav-link.active::after {
    background: var(--accent);
}

body.dark-mode .nav-link:hover {
    color: var(--accent);
    background: rgba(33, 150, 243, 0.05);
}

.otp-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 25px 0 35px;
}

.otp-input {
    width: 60px;
    height: 70px;
    text-align: center;
    font-size: 1.8rem;
    font-weight: bold;
    background: var(--light);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    transition: var(--transition);
}

.otp-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(42, 107, 204, 0.1);
    background: white;
}

body.dark-mode .otp-input {
    background: #23272e;
    border-color: #343a40;
    color: #e0e0e0;
}

body.dark-mode .otp-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.2);
}

.resend-link {
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
}

.resend-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.resend-link a:hover {
    text-decoration: underline;
}

body.dark-mode .resend-link a {
    color: var(--accent);
}

.password-toggle {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    cursor: pointer;
    z-index: 5;
}

.terms {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 20px 0;
}

.terms input {
    margin-top: 5px;
}

.terms label {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.5;
}

.terms a {
    color: var(--primary);
    font-weight: 500;
}

body.dark-mode .terms label {
    color: #e0e0e0;
}

body.dark-mode .terms a {
    color: var(--accent);
}

.success-message {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.2);
    border-radius: 10px;
    padding: 15px 40px 15px 15px; /* extra right padding for close button */
    margin-bottom: 25px;
    text-align: center;
    color: var(--success);
    font-weight: 500;
    position: relative;
}

.error-message {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 10px;
    padding: 15px 40px 15px 15px;
    margin-bottom: 25px;
    text-align: center;
    color: var(--danger);
    font-weight: 500;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    color: inherit;
}
.close-btn:hover {
    opacity: 0.7;
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(42, 107, 204, 0.1);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}

.theme-toggle:hover {
    background: rgba(42, 107, 204, 0.2);
    transform: rotate(30deg);
}

.theme-toggle i {
    font-size: 1.4rem;
    color: var(--primary);
}

body.dark-mode .theme-toggle {
    background: rgba(33, 150, 243, 0.1);
}

body.dark-mode .theme-toggle:hover {
    background: rgba(33, 150, 243, 0.2);
}

body.dark-mode .theme-toggle i {
    color: var(--accent);
}

body.dark-mode .toast {
    background: #23272e;
    border-left: 5px solid var(--accent);
}



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

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

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.7;
    }
    50% {
        transform: scale(1);
        opacity: 0.3;
    }
    100% {
        transform: scale(0.8);
        opacity: 0.7;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    to {
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
        max-width: 500px;
    }
    
    .auth-illustration {
        padding: 30px 20px;
        display: none;
    }
    
    .auth-forms {
        padding: 30px;
    }
    
    .illustration-content {
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .auth-container {
        max-width: 100%;
    }
    
    .otp-input {
        width: 50px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .social-login {
        flex-direction: column;
    }
}