/* ================================================
   ROGHost Control Panel - Login Styles
   Modern, Secure, Professional
   Dark Grey & Green Theme
   ================================================ */

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

:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #34d399;
    --primary-glow: rgba(16, 185, 129, 0.4);
    --secondary: #14b8a6;
    --background: #0a0a0a;
    --surface: #141414;
    --surface-light: #1f1f1f;
    --surface-border: #2a2a2a;
    --text: #f5f5f5;
    --text-muted: #737373;
    --text-subtle: #525252;
    --error: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --border: #333333;
    --input-bg: #0d0d0d;
}

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

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

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

.background-animation::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(20, 184, 166, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(16, 185, 129, 0.03) 0%, transparent 60%);
    animation: backgroundPulse 20s ease-in-out infinite;
}

.background-animation::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.3) 100%);
    pointer-events: none;
}

@keyframes backgroundPulse {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 1; }
    25% { transform: translate(-3%, 3%) scale(1.02); opacity: 0.8; }
    50% { transform: translate(3%, -3%) scale(1); opacity: 1; }
    75% { transform: translate(-2%, -2%) scale(1.01); opacity: 0.9; }
}

/* Grid Pattern Overlay */
.background-animation .grid-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(16, 185, 129, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 185, 129, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.5;
}

/* Floating Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.2;
    animation: float 25s infinite;
    box-shadow: 0 0 6px var(--primary-glow);
}

@keyframes float {
    0%, 100% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.2; }
    90% { opacity: 0.2; }
    100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

/* Login Container */
.login-container {
    width: 100%;
    max-width: 720px;
    padding: 24px;
    position: relative;
    z-index: 10;
}

.login-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 48px 64px;
    box-shadow: 
        0 0 0 1px var(--surface-border),
        0 25px 50px -12px rgba(0, 0, 0, 0.6),
        0 0 100px -30px var(--primary-glow);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--primary-dark), 
        var(--primary), 
        var(--primary-light), 
        var(--primary), 
        var(--primary-dark), 
        transparent);
    background-size: 200% 100%;
    animation: gradientFlow 4s ease infinite;
}

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

.login-card:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 0 0 1px var(--surface-border),
        0 30px 60px -15px rgba(0, 0, 0, 0.7),
        0 0 120px -30px var(--primary-glow);
}

/* Logo & Header */
.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: linear-gradient(145deg, var(--surface-light), var(--surface));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 0 0 1px var(--surface-border),
        0 10px 30px -10px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.logo::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(16, 185, 129, 0.1), transparent);
    animation: logoShine 4s ease infinite;
}

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

.logo svg {
    width: 36px;
    height: 36px;
    stroke: var(--primary);
    z-index: 1;
}

.login-header h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
    letter-spacing: -0.5px;
}

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

/* Form Elements */
.form-group {
    margin-bottom: 22px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper .icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-subtle);
    transition: color 0.3s ease;
    pointer-events: none;
}

.input-wrapper .icon svg {
    width: 20px;
    height: 20px;
}

.form-group input {
    width: 100%;
    padding: 16px 16px 16px 52px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.25s ease;
    outline: none;
}

.form-group input::placeholder {
    color: var(--text-subtle);
}

.form-group input:hover {
    border-color: #404040;
}

.form-group input:focus {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.03);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group input:focus ~ .icon,
.input-wrapper:focus-within .icon {
    color: var(--primary);
}

.form-group input.error {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.03);
}

.form-group input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* PIN Input Special Styling */
.pin-section {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--surface-border);
}

.pin-input-container {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.pin-group {
    display: flex;
    gap: 6px;
}

.pin-digit {
    width: 36px;
    height: 48px;
    text-align: center;
    padding: 0;
    font-size: 20px;
    font-weight: 600;
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--primary-light);
    transition: all 0.2s ease;
    outline: none;
}

.pin-digit:hover {
    border-color: #404040;
}

.pin-digit:focus {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.05);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
    transform: translateY(-2px);
}

.pin-digit.filled {
    border-color: var(--primary-dark);
    background: rgba(16, 185, 129, 0.08);
    color: var(--primary);
}

.pin-digit.error {
    border-color: var(--error);
    animation: shake 0.5s ease;
}

.pin-separator {
    display: flex;
    align-items: center;
    color: var(--text-subtle);
    font-size: 24px;
    padding: 0 2px;
    font-weight: 300;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-3px); }
    40% { transform: translateX(3px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

/* Character Counter */
.char-counter {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-subtle);
    opacity: 0;
    transition: opacity 0.3s ease;
    background: var(--input-bg);
    padding: 2px 6px;
    border-radius: 4px;
}

.form-group input:focus ~ .char-counter {
    opacity: 1;
}

.char-counter.warning {
    color: var(--warning);
}

.char-counter.limit {
    color: var(--error);
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 28px;
    box-shadow: 0 4px 20px -5px var(--primary-glow);
}

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

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

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px -5px var(--primary-glow);
}

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

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.submit-btn .btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.submit-btn .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

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

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

.submit-btn svg {
    opacity: 0.8;
}

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

/* Error/Success Messages */
.message {
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 24px;
    display: none;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

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

.message.show {
    display: flex;
}

.message.error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.message.success {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.message.warning {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.message svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

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

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

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.login-footer a:hover {
    color: var(--primary-light);
}

/* Security Badge */
.security-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    color: var(--text-subtle);
    font-size: 12px;
    background: var(--surface-light);
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--surface-border);
}

.security-badge svg {
    width: 14px;
    height: 14px;
    stroke: var(--primary);
}

/* Responsive */
@media (max-width: 560px) {
    .login-container {
        padding: 16px;
        max-width: 100%;
    }
    
    .login-card {
        padding: 36px 28px;
        border-radius: 16px;
    }
    
    .login-header h1 {
        font-size: 22px;
    }
    
    .pin-digit {
        width: 34px;
        height: 46px;
        font-size: 18px;
    }
    
    .pin-separator {
        padding: 0;
        font-size: 18px;
    }
    
    .pin-group {
        gap: 4px;
    }
    
    .pin-input-container {
        gap: 6px;
    }
}

/* Lockout Screen */
.lockout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.97);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.lockout-overlay.show {
    display: flex;
}

.lockout-content {
    text-align: center;
    padding: 48px;
    background: var(--surface);
    border-radius: 20px;
    max-width: 420px;
    box-shadow: 
        0 0 0 1px var(--surface-border),
        0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

.lockout-content svg {
    width: 56px;
    height: 56px;
    stroke: var(--error);
    margin-bottom: 24px;
}

.lockout-content h2 {
    color: var(--text);
    margin-bottom: 10px;
    font-size: 22px;
}

.lockout-content p {
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 14px;
    line-height: 1.6;
}

.lockout-timer {
    font-size: 52px;
    font-weight: 700;
    color: var(--primary);
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    text-shadow: 0 0 30px var(--primary-glow);
}

/* Password Visibility Toggle */
.toggle-password {
    position: absolute;
    right: 48px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-subtle);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: var(--primary);
    background: rgba(16, 185, 129, 0.1);
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

/* 2FA Modal */
.twofa-container {
    animation: slideIn 0.3s ease;
}

.twofa-header {
    text-align: center;
    margin-bottom: 32px;
}

.twofa-header svg {
    stroke: var(--primary);
    margin-bottom: 20px;
}

.twofa-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.twofa-header p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.twofa-input-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 28px 0;
}

.twofa-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--primary);
    transition: all 0.2s ease;
    outline: none;
}

.twofa-digit:hover {
    border-color: #404040;
}

.twofa-digit:focus {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.05);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
    transform: translateY(-2px);
}

.cancel-btn {
    width: 100%;
    padding: 14px 24px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 12px;
}

.cancel-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(16, 185, 129, 0.05);
}

/* Focus ring for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

input:focus-visible {
    outline: none;
}
