/* 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 glow effect */
.login-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.login-bg::before {
    content: '';
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.08) 0%, transparent 70%);
    border-radius: 50%;
}

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

/* Login card */
.login-card {
    background: linear-gradient(135deg, var(--rr-navy-light) 0%, var(--rr-navy-lighter) 100%);
    border: 1px solid var(--border-dark);
    border-radius: 16px;
    padding: 40px 36px;
    box-shadow: var(--shadow-glow);
}

/* 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: var(--rr-red);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.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);
}

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

.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;
    }
}
