@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Rajdhani:wght@500;600;700&display=swap');

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

:root {
    --primary-bg: #0a0e27;
    --secondary-bg: #151932;
    --accent-cyan: #00d9ff;
    --accent-blue: #0066ff;
    --text-primary: #ffffff;
    --text-secondary: #8892b0;
    --border-color: #1e2a4a;
    --glow-color: rgba(0, 217, 255, 0.3);
    --error-color: #ff3366;
    --success-color: #00ff88;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #151932 50%, #0a0e27 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

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

/* Animated grid background */
body::before {
    content: '';
    position: absolute;
    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: 50px 50px;
    animation: gridScroll 20s linear infinite;
    pointer-events: none;
}

@keyframes gridScroll {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Floating particles */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: var(--accent-cyan);
    border-radius: 50%;
    opacity: 0.1;
    animation: float 15s infinite ease-in-out;
}

.particle:nth-child(1) { width: 3px; height: 3px; left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { width: 2px; height: 2px; left: 20%; animation-delay: 2s; }
.particle:nth-child(3) { width: 4px; height: 4px; left: 30%; animation-delay: 4s; }
.particle:nth-child(4) { width: 2px; height: 2px; left: 40%; animation-delay: 6s; }
.particle:nth-child(5) { width: 3px; height: 3px; left: 50%; animation-delay: 8s; }
.particle:nth-child(6) { width: 2px; height: 2px; left: 60%; animation-delay: 10s; }
.particle:nth-child(7) { width: 4px; height: 4px; left: 70%; animation-delay: 12s; }
.particle:nth-child(8) { width: 3px; height: 3px; left: 80%; animation-delay: 14s; }
.particle:nth-child(9) { width: 2px; height: 2px; left: 90%; animation-delay: 16s; }

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

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    padding: 20px;
}

.login-card {
    background: rgba(21, 25, 50, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 48px 40px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(0, 217, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: slideIn 0.6s ease-out;
}

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

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

.logo {
    width: 180px;
    height: auto;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 20px rgba(0, 217, 255, 0.3));
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(0, 217, 255, 0.3)); }
    50% { filter: drop-shadow(0 0 30px rgba(0, 217, 255, 0.5)); }
}

.subtitle {
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent-cyan);
    margin-bottom: 8px;
}

.description {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
}

.login-form {
    margin-top: 32px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(10, 14, 39, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--accent-cyan);
    background: rgba(10, 14, 39, 0.8);
    box-shadow: 0 0 0 3px var(--glow-color);
}

.form-input::placeholder {
    color: rgba(136, 146, 176, 0.5);
}

.form-actions {
    margin-top: 32px;
}

.btn-login {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    font-family: 'Rajdhani', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

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

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 217, 255, 0.4);
}

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

.security-badge {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.security-icon {
    width: 20px;
    height: 20px;
    color: var(--success-color);
}

.security-text {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

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

.alert-error {
    background: rgba(255, 51, 102, 0.1);
    border: 1px solid rgba(255, 51, 102, 0.3);
    color: var(--error-color);
}

.alert-success {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: var(--success-color);
}

@media (max-width: 600px) {
    .login-card {
        padding: 32px 24px;
    }

    .logo {
        width: 140px;
    }
}

/* ===== Spelling Variants / Obfuscation Selector Styles ===== */

.spelling-type-selector {
    margin-bottom: 20px;
}

.type-options {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.type-option {
    flex: 1;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.type-option span {
    display: block;
    padding: 12px 16px;
    background: var(--secondary-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.type-option small {
    display: block;
    font-size: 11px;
    margin-top: 4px;
    opacity: 0.7;
    font-weight: 400;
}

.type-option:hover span {
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.2);
}

.type-option input[type="radio"]:checked + span {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1) 0%, rgba(0, 102, 255, 0.1) 100%);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
}

.spelling-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 14px;
}

.spelling-level-selector {
    margin-bottom: 20px;
}

.level-options {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.level-option {
    flex: 1;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.level-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.level-option span {
    display: block;
    padding: 10px 14px;
    background: var(--secondary-bg);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    font-size: 14px;
}

.level-option small {
    display: block;
    font-size: 10px;
    margin-top: 2px;
    opacity: 0.6;
    font-weight: 400;
}

.level-option:hover span {
    border-color: var(--accent-cyan);
    transform: translateY(-1px);
}

.level-option input[type="radio"]:checked + span {
    background: rgba(0, 217, 255, 0.15);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

@media (max-width: 768px) {
    .type-options {
        flex-direction: column;
    }

    .level-options {
        flex-direction: column;
    }
}

/* ===== Option Toggle Styles (Engagement Tracking) ===== */

.option-toggles {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.option-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.option-toggle input[type="checkbox"] {
    display: none;
}

.toggle-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-switch {
    width: 36px;
    height: 20px;
    background: rgba(100, 100, 130, 0.3);
    border-radius: 10px;
    position: relative;
    transition: all 0.2s ease;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #8892b0;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.2s ease;
}

.option-toggle input:checked + .toggle-content .toggle-switch {
    background: rgba(0, 217, 255, 0.3);
}

.option-toggle input:checked + .toggle-content .toggle-switch::after {
    background: var(--accent-cyan);
    left: 18px;
}

.toggle-label {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    line-height: 1.4;
    opacity: 0.8;
}
