:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --accent: #f093fb;
    --light: #f8f9fa;
    --dark: #2d3748;
    --success: #68d391;
    --error: #fc8181;
    --gradient-start: #667eea;
    --gradient-end: #764ba2;
    --glow-color: rgba(102, 126, 234, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Poppins', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: white;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background */
.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 20s infinite linear;
}

.shape:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 15%;
    left: 8%;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 120px;
    height: 120px;
    top: 65%;
    left: 85%;
    animation-delay: -3s;
}

.shape:nth-child(3) {
    width: 60px;
    height: 60px;
    top: 80%;
    left: 15%;
    animation-delay: -7s;
}

.shape:nth-child(4) {
    width: 100px;
    height: 100px;
    top: 25%;
    left: 75%;
    animation-delay: -5s;
}

.shape:nth-child(5) {
    width: 90px;
    height: 90px;
    top: 45%;
    left: 10%;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 0.6;
    }
    25% {
        transform: translateY(-40px) rotate(90deg) scale(1.1);
        opacity: 0.8;
    }
    50% {
        transform: translateY(20px) rotate(180deg) scale(0.9);
        opacity: 0.4;
    }
    75% {
        transform: translateY(-20px) rotate(270deg) scale(1.05);
        opacity: 0.7;
    }
}

/* Glass Morphism Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 1.2rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    transition: all 0.4s ease;
}

.logo:hover {
    transform: translateY(-3px);
    text-shadow: 0 0 20px var(--glow-color);
}

.logo img {
    height: 45px;
    margin-right: 12px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.4));
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: rotate(10deg) scale(1.1);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.8rem;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 600;
    padding: 0.8rem 1.4rem;
    border-radius: 15px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.nav-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.nav-links a:hover::before {
    left: 100%;
}

.nav-links a:hover, 
.nav-links a.active {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-3px);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0.6rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(90deg);
}

/* Enhanced Alert Styles */
.alert-container {
    position: fixed;
    top: 110px;
    right: 25px;
    z-index: 1000;
    max-width: 420px;
}

.alert {
    padding: 1.3rem 1.8rem;
    border-radius: 16px;
    margin-bottom: 1.2rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
    transform-origin: right center;
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
}

.alert-success {
    background: rgba(104, 211, 145, 0.2);
    color: white;
    border-left: 6px solid var(--success);
}

.alert-error {
    background: rgba(252, 129, 129, 0.2);
    color: white;
    border-left: 6px solid var(--error);
}

@keyframes slideIn {
    from {
        transform: translateX(100%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* Premium Forgot Password Container */
.forgot-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    position: relative;
}

.forgot-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 28px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(255, 255, 255, 0.15),
                inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    overflow: hidden;
    width: 100%;
    max-width: 500px;
    color: white;
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation: cardAppear 0.8s ease;
}

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

.forgot-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 35px 60px rgba(0, 0, 0, 0.2),
                0 0 0 1px rgba(255, 255, 255, 0.2),
                inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.forgot-header {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    padding: 3rem 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.forgot-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    animation: shine 4s infinite;
    animation-timing-function: ease-in-out;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    50% { transform: translateX(100%) translateY(100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.forgot-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.5));
    position: relative;
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-10px) rotate(5deg);
    }
    66% {
        transform: translateY(5px) rotate(-3deg);
    }
}

.forgot-header h1 {
    font-weight: 700;
    margin-bottom: 0.8rem;
    font-size: 2.2rem;
    position: relative;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
}

.forgot-header p {
    opacity: 0.95;
    font-weight: 500;
    position: relative;
    font-size: 1.1rem;
    line-height: 1.6;
}

.forgot-body {
    padding: 3rem 2.5rem;
    position: relative;
}

.form-group {
    margin-bottom: 2rem;
    position: relative;
}

.form-label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
    letter-spacing: -0.2px;
    transition: all 0.3s ease;
}

.form-control {
    width: 100%;
    padding: 1.1rem 1.4rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-size: 1rem;
    transition: all 0.4s ease;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(10px);
    font-weight: 500;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.form-control:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.15),
                inset 0 3px 8px rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

/* Enhanced Instructions Box */
.instructions {
    background: rgba(255, 255, 255, 0.08);
    border-left: 6px solid var(--primary);
    padding: 1.5rem;
    border-radius: 0 16px 16px 0;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.instructions::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 50%);
    pointer-events: none;
}

.instructions p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    margin: 0;
    font-weight: 500;
    line-height: 1.6;
}

/* Enhanced Submit Button */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    border: none;
    padding: 1.3rem;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
    letter-spacing: 0.5px;
}

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

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

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.5);
    letter-spacing: 1px;
}

.submit-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

/* Back to Login Link */
.back-to-login {
    text-align: center;
    margin-top: 2.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 1.05rem;
}

.back-to-login a {
    color: white;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.4s ease;
    position: relative;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    margin-left: 0.3rem;
}

.back-to-login a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: white;
    transition: width 0.4s ease;
}

.back-to-login a:hover {
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.15);
}

.back-to-login a:hover::after {
    width: 100%;
}

/* Enhanced Footer */
.footer {
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(15px);
    padding: 2rem 0;
    text-align: center;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.footer p {
    opacity: 0.9;
    font-weight: 600;
    font-size: 1.05rem;
}

/* Input Focus Animation */
.form-group::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    transition: width 0.4s ease;
    border-radius: 2px;
}

.form-group:focus-within::after {
    width: 100%;
}

/* Success State Animation */
.success-state {
    text-align: center;
    padding: 2rem;
    animation: successAppear 0.6s ease;
}

.success-state .forgot-icon {
    color: var(--success);
    animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(104, 211, 145, 0.5));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 20px rgba(104, 211, 145, 0.8));
    }
}

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

.success-state h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--success);
    font-weight: 700;
}

.success-state p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

/* Loading Animation for Button */
.submit-btn.loading {
    pointer-events: none;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form Validation Styles */
.form-control.invalid {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(252, 129, 129, 0.2);
}

.form-control.valid {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(104, 211, 145, 0.2);
}

.validation-message {
    position: absolute;
    bottom: -1.2rem;
    left: 0;
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.validation-message.show {
    opacity: 1;
    transform: translateY(0);
}

.validation-message.error {
    color: var(--error);
}

.validation-message.success {
    color: var(--success);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(25px);
        flex-direction: column;
        padding: 1.5rem 0;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        border-radius: 0 0 25px 25px;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links li {
        margin: 0;
    }
    
    .nav-links a {
        display: block;
        padding: 1.2rem 2rem;
        color: var(--dark);
        border-radius: 0;
        font-weight: 600;
    }
    
    .nav-links a:hover,
    .nav-links a.active {
        background: rgba(102, 126, 234, 0.15);
        color: var(--gradient-start);
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .forgot-body {
        padding: 2.5rem 2rem;
    }
    
    .forgot-header {
        padding: 2.5rem 2rem;
    }
    
    .forgot-header h1 {
        font-size: 2rem;
    }
    
    .forgot-icon {
        font-size: 3.5rem;
    }
    
    .alert-container {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Progress Bar for Password Reset */
.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-bottom: 1rem;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    border-radius: 2px;
    transition: width 0.4s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { left: -100%; }
    100% { left: 100%; }
}