*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0D1B2A;
    --secondary: #1B263B;
    --accent: #00D9FF;
    --accent-alt: #7B61FF;
    --success: #00E676;
    --text: #E0E1DD;
    --text-muted: #778DA9;
    --gradient-main: linear-gradient(135deg, #00D9FF 0%, #7B61FF 50%, #FF006E 100%);
    --gradient-card: linear-gradient(145deg, rgba(27, 38, 59, 0.9), rgba(13, 27, 42, 0.95));
    --glow: 0 0 40px rgba(0, 217, 255, 0.3);
    --font-main: 'Outfit', sans-serif;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-main);
    background: var(--primary);
    color: var(--text);
    line-height: 1.6;
}

/* Animated Background */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.bg-animation::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 217, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(123, 97, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 0, 110, 0.06) 0%, transparent 40%);
    animation: bgFloat 20s ease-in-out infinite;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(5deg); }
    66% { transform: translate(-20px, 20px) rotate(-5deg); }
}

.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 217, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 217, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 0;
    pointer-events: none;
}

/* Login Container */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Login Box */
.login-box {
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 217, 255, 0.15);
    border-radius: 24px;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(0, 217, 255, 0.05);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    position: relative;
    overflow: hidden;
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-main);
}

/* Header */
.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 20px;
    box-shadow: var(--glow);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.login-brand {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.login-brand .emi {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-brand .tron {
    color: var(--text);
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 400;
}

/* Alert Messages */
.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: none;
    font-size: 0.95rem;
    font-weight: 500;
}

.alert-error {
    background: rgba(255, 0, 110, 0.15);
    color: #FF006E;
    border: 1px solid rgba(255, 0, 110, 0.3);
}

.alert-success {
    background: rgba(0, 230, 118, 0.15);
    color: var(--success);
    border: 1px solid rgba(0, 230, 118, 0.3);
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    transition: color 0.3s ease;
}

.form-group input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: rgba(13, 27, 42, 0.6);
    border: 2px solid rgba(119, 141, 169, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    font-family: var(--font-main);
    color: var(--text);
    transition: all 0.3s ease;
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.15);
}

.form-group input:focus + i,
.input-wrapper:focus-within i {
    color: var(--accent);
}

/* Terms Acceptance Checkbox */
.terms-accept {
    margin: 20px 0 8px;
}

.terms-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    position: relative;
    padding-left: 0;
}

.terms-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.terms-checkbox-label .checkmark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid rgba(119, 141, 169, 0.3);
    border-radius: 6px;
    background: rgba(13, 27, 42, 0.6);
    transition: all 0.3s ease;
    margin-top: 1px;
}

.terms-checkbox-label .checkmark::after {
    content: '';
    display: none;
    width: 6px;
    height: 10px;
    border: solid var(--primary);
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.terms-checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(0, 217, 255, 0.3);
}

.terms-checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    display: block;
}

.terms-checkbox-label input[type="checkbox"]:focus + .checkmark {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.15);
}

.terms-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.terms-text a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.terms-text a:hover {
    text-decoration: underline;
    text-shadow: 0 0 8px rgba(0, 217, 255, 0.3);
}

/* Button */
.btn-login {
    width: 100%;
    padding: 16px;
    background: var(--gradient-main);
    color: var(--primary);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 25px rgba(0, 217, 255, 0.3);
    margin-top: 8px;
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 35px rgba(0, 217, 255, 0.4);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-login i {
    font-size: 1.1rem;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 28px 0;
    gap: 16px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(119, 141, 169, 0.2);
}

.divider span {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Back Link */
.back-link {
    text-align: center;
}

.back-link a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-link a:hover {
    color: var(--accent);
}

.back-link a i {
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.back-link a:hover i {
    transform: translateX(-4px);
}

/* Features Info */
.login-features {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(119, 141, 169, 0.15);
}

.login-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.login-feature i {
    font-size: 1.3rem;
    color: var(--accent);
}

.login-feature span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Floating Elements */
.floating-element {
    position: absolute;
    border-radius: 50%;
    background: var(--gradient-main);
    opacity: 0.1;
    filter: blur(60px);
    pointer-events: none;
}

.floating-element.el-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -100px;
}

.floating-element.el-2 {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -50px;
}

/* Responsive */
@media (max-width: 480px) {
    .login-container {
        padding: 16px;
    }

    .login-box {
        padding: 32px 24px;
        border-radius: 20px;
    }

    .login-logo {
        width: 64px;
        height: 64px;
        border-radius: 16px;
    }

    .login-brand {
        font-size: 1.6rem;
    }

    .login-subtitle {
        font-size: 0.9rem;
    }

    .form-group input {
        padding: 12px 14px 12px 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .btn-login {
        padding: 14px;
    }

    .login-features {
        gap: 16px;
    }

    .login-feature i {
        font-size: 1.1rem;
    }

    .login-feature span {
        font-size: 0.7rem;
    }
}
