/* Red Rocket Cockpit - Login Page
   Matches main style.css design language
*/

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

:root {
    --rr-navy: #0A1628;
    --rr-navy-light: #0F2137;
    --rr-navy-lighter: #162844;
    --rr-red: #EF4444;
    --rr-red-hover: #DC2626;
    --rr-red-light: rgba(239, 68, 68, 0.1);
    --text-white: #FFFFFF;
    --text-light: #F1F5F9;
    --text-muted: #94A3B8;
    --border-dark: rgba(255, 255, 255, 0.08);
    --shadow-glow: 0 0 40px rgba(239, 68, 68, 0.15);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--rr-navy);
    color: var(--text-white);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Background with grid + gradient glow (matches redrocketonline.nl hero) */
.login-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

/* Radial gradient glows */
.login-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(239, 68, 68, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(26, 58, 92, 0.25) 0%, transparent 50%);
    animation: gradientShift 10s ease infinite;
}

/* Grid pattern overlay */
.login-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Floating red particles */
.particle {
    position: fixed;
    bottom: 0;
    width: 6px;
    height: 6px;
    background: var(--rr-red);
    border-radius: 50%;
    opacity: 0;
    z-index: 0;
    animation: particleRise linear infinite;
}

@keyframes particleRise {
    0% { transform: translateY(0) scale(1); opacity: 0; }
    10% { opacity: 0.4; }
    90% { opacity: 0.4; }
    100% { transform: translateY(-100vh) scale(0.3); opacity: 0; }
}

/* Flying rocket */
.rocket {
    position: fixed;
    z-index: 1;
    width: 120px;
    height: 120px;
    animation: rocketFly 10s linear infinite;
    filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.6));
    opacity: 0;
    pointer-events: none;
}

.rocket svg {
    width: 100%;
    height: 100%;
}

@keyframes rocketFly {
    0% {
        left: -100px;
        top: 75%;
        opacity: 0;
        transform: rotate(-20deg) scale(0.5);
    }
    5% {
        opacity: 0.85;
        transform: rotate(-20deg) scale(0.6);
    }
    25% {
        left: 30%;
        top: 45%;
        transform: rotate(-15deg) scale(0.8);
    }
    50% {
        left: 60%;
        top: 25%;
        opacity: 0.85;
        transform: rotate(-10deg) scale(0.9);
    }
    75% {
        left: 85%;
        top: 15%;
        transform: rotate(-5deg) scale(1);
    }
    90% {
        opacity: 0.85;
    }
    100% {
        left: 110%;
        top: 5%;
        opacity: 0;
        transform: rotate(0deg) scale(1);
    }
}

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

/* Login card */
.login-card {
    background: linear-gradient(135deg, rgba(15, 33, 55, 0.6) 0%, rgba(22, 40, 68, 0.5) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.08), 0 24px 48px rgba(0, 0, 0, 0.3);
}

/* Logo */
.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-text {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.login-logo .logo-text span {
    color: var(--rr-red);
}

.login-logo .logo-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 4px;
}

/* Welcome text */
.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.login-header p {
    font-size: 14px;
    color: var(--text-muted);
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    color: var(--text-white);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-group input:focus {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08), 0 0 20px rgba(239, 68, 68, 0.06);
}

.form-group input::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

/* Password field with toggle */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 4px;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: var(--text-white);
}

/* Submit button */
.btn-login {
    width: 100%;
    padding: 13px 24px;
    background: var(--rr-red);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover {
    background: var(--rr-red-hover);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.2), 0 0 60px rgba(239, 68, 68, 0.08);
}

.btn-login:active {
    transform: scale(0.98);
    box-shadow: none;
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}

.btn-login.loading .spinner {
    display: block;
}

.btn-login.loading .btn-text {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error message */
.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    color: #FCA5A5;
    display: none;
}

.login-error.visible {
    display: block;
}

/* Success message */
.login-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    color: #86EFAC;
    display: none;
}

.login-success.visible {
    display: block;
}

/* Forgot password link */
.forgot-link {
    text-align: center;
    margin-top: 4px;
}

.forgot-link a {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link a:hover {
    color: var(--rr-red);
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-dark);
}

.login-footer p {
    font-size: 12px;
    color: var(--text-muted);
}

/* Reset password form (hidden by default) */
.reset-form {
    display: none;
}

.reset-form.active {
    display: flex;
}

.login-form.hidden {
    display: none;
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
    margin-bottom: 8px;
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
}

.back-link:hover {
    color: var(--text-white);
}

/* Change password form */
.change-password-form {
    display: none;
}

.change-password-form.active {
    display: flex;
}

/* Responsive */
@media (max-width: 480px) {
    .login-container {
        padding: 16px;
    }

    .login-card {
        padding: 32px 24px;
    }
}
