/* =====================================================
   HELLFIRE GAME - MAIN STYLESHEET
   Theme: Infernal Hell Fire
   ===================================================== */

/* CSS Variables */
:root {
    /* Fire Colors */
    --fire-core: #fff7e6;
    --fire-inner: #ffd93d;
    --fire-middle: #ff7b00;
    --fire-outer: #ff4500;
    --fire-edge: #cc0000;
    --fire-dark: #8b0000;
    
    /* Hell Theme Colors */
    --hell-black: #0a0a0a;
    --hell-charcoal: #1a1a1a;
    --hell-gray: #2a2a2a;
    --hell-red: #8b0000;
    --hell-crimson: #dc143c;
    --hell-ember: #ff4500;
    --hell-gold: #ffd700;
    --hell-orange: #ff7b00;
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #888888;
    --text-fire: #ffd93d;
    
    /* Gradients */
    --gradient-fire: linear-gradient(180deg, #ffd93d 0%, #ff7b00 30%, #ff4500 60%, #cc0000 100%);
    --gradient-lava: linear-gradient(135deg, #8b0000 0%, #cc0000 25%, #ff4500 50%, #ff7b00 75%, #ffd700 100%);
    --gradient-ember: linear-gradient(45deg, #ff4500, #ff7b00, #ffd93d, #ff7b00, #ff4500);
    --gradient-dark: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
    
    /* Shadows */
    --shadow-fire: 0 0 30px rgba(255, 69, 0, 0.5), 0 0 60px rgba(255, 123, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(255, 215, 0, 0.4);
    --shadow-dark: 0 10px 40px rgba(0, 0, 0, 0.8);
    
    /* Sizes */
    --container-max: 1200px;
    --auth-max: 450px;
    --border-radius: 12px;
    --border-radius-lg: 20px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Fonts */
    --font-display: 'Cinzel', serif;
    --font-body: 'Rajdhani', sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--hell-black);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* =====================================================
   ANIMATED FIRE BACKGROUND
   ===================================================== */
.fire-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(to bottom, 
        #0a0a0a 0%, 
        #1a0505 40%, 
        #2a0a0a 60%, 
        #3a0f0f 80%, 
        #4a1414 100%
    );
}

.fire-layer {
    position: absolute;
    bottom: -20%;
    left: 0;
    width: 200%;
    height: 60%;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 800 600' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3CradialGradient id='fire1' cx='50%25' cy='100%25' r='80%25'%3E%3Cstop offset='0%25' style='stop-color:%23ff4500;stop-opacity:0.8'/%3E%3Cstop offset='50%25' style='stop-color:%23ff7b00;stop-opacity:0.5'/%3E%3Cstop offset='100%25' style='stop-color:%23000;stop-opacity:0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Crect fill='url(%23fire1)' width='800' height='600'/%3E%3C/svg%3E") repeat-x;
    background-size: 400px 100%;
    animation: fireWave 4s ease-in-out infinite;
    opacity: 0.6;
}

.fire-layer-1 {
    animation-delay: 0s;
    opacity: 0.7;
}

.fire-layer-2 {
    animation-delay: -1.5s;
    opacity: 0.5;
    transform: scaleX(-1);
}

.fire-layer-3 {
    animation-delay: -3s;
    opacity: 0.4;
    height: 50%;
}

@keyframes fireWave {
    0%, 100% {
        transform: translateX(0) translateY(0) scaleY(1);
    }
    25% {
        transform: translateX(-5%) translateY(-5px) scaleY(1.05);
    }
    50% {
        transform: translateX(-10%) translateY(0) scaleY(1);
    }
    75% {
        transform: translateX(-5%) translateY(-3px) scaleY(1.02);
    }
}

.smoke-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center bottom, transparent 0%, rgba(10, 10, 10, 0.4) 50%, rgba(10, 10, 10, 0.9) 100%);
    pointer-events: none;
}

.ember-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

/* =====================================================
   MAIN CONTAINER
   ===================================================== */
.main-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* =====================================================
   HEADER & LOGO
   ===================================================== */
.header {
    text-align: center;
    padding: 40px 20px;
}

.logo-container {
    position: relative;
    display: inline-block;
}

.logo-fire-effect {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 150%;
    height: 150%;
    background: radial-gradient(ellipse at center, rgba(255, 123, 0, 0.3) 0%, transparent 70%);
    filter: blur(20px);
    animation: logoPulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes logoPulse {
    0%, 100% {
        opacity: 0.5;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translateX(-50%) scale(1.1);
    }
}

.logo {
    font-family: var(--font-display);
    font-size: clamp(3rem, 10vw, 5rem);
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    position: relative;
    text-shadow: 
        0 0 10px rgba(255, 123, 0, 0.8),
        0 0 20px rgba(255, 69, 0, 0.6),
        0 0 40px rgba(204, 0, 0, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.8);
}

.logo-hell {
    color: var(--fire-dark);
    background: linear-gradient(180deg, #cc0000 0%, #8b0000 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-fire {
    color: var(--fire-inner);
    background: var(--gradient-fire);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fireFlicker 2s ease-in-out infinite;
}

@keyframes fireFlicker {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.2);
    }
}

.tagline {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.5em;
    text-transform: uppercase;
    margin-top: 10px;
    opacity: 0.8;
}

/* =====================================================
   AUTH CONTAINER
   ===================================================== */
.auth-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: var(--auth-max);
    width: 100%;
    margin: 0 auto;
    padding: 20px 0;
}

/* Tab Switcher */
.tab-container {
    display: flex;
    position: relative;
    background: rgba(30, 30, 30, 0.8);
    border-radius: 50px;
    padding: 5px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 0, 0, 0.3);
    box-shadow: var(--shadow-dark);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition-normal);
    z-index: 2;
    position: relative;
}

.tab-btn:hover {
    color: var(--text-secondary);
}

.tab-btn.active {
    color: var(--text-primary);
}

.tab-icon {
    width: 18px;
    height: 18px;
}

.tab-indicator {
    position: absolute;
    top: 5px;
    left: 5px;
    height: calc(100% - 10px);
    width: calc(50% - 5px);
    background: var(--gradient-lava);
    border-radius: 50px;
    transition: var(--transition-normal);
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.5);
}

.tab-container:has(.tab-btn[data-tab="register"].active) .tab-indicator {
    transform: translateX(100%);
}

/* Auth Forms */
.auth-form {
    width: 100%;
    background: rgba(20, 20, 20, 0.9);
    border-radius: var(--border-radius-lg);
    padding: 35px 30px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 0, 0, 0.4);
    box-shadow: 
        var(--shadow-dark),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    display: none;
    animation: formFadeIn 0.4s ease;
}

.auth-form.active {
    display: block;
}

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

/* Form Header */
.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-fire);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    margin-bottom: 8px;
}

.form-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Form Groups */
.form-group {
    margin-bottom: 22px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.label-icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

/* Input Fields */
.input-container {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-primary);
    background: rgba(40, 40, 40, 0.8);
    border: 2px solid rgba(80, 80, 80, 0.5);
    border-radius: var(--border-radius);
    outline: none;
    transition: var(--transition-normal);
}

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

.form-input:hover {
    border-color: rgba(139, 0, 0, 0.5);
}

.form-input:focus {
    border-color: var(--fire-middle);
    box-shadow: 0 0 20px rgba(255, 123, 0, 0.2);
}

.form-input:focus + .input-fire-border,
.input-container:focus-within .input-fire-border {
    opacity: 1;
}

.input-fire-border {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gradient-lava);
    border-radius: 1px;
    transition: var(--transition-normal);
    opacity: 0;
}

.form-input:focus ~ .input-fire-border {
    width: 100%;
    opacity: 1;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.password-toggle:hover {
    color: var(--fire-middle);
}

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

.password-toggle .hidden {
    display: none;
}

/* Input Hint */
.input-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
    padding-left: 2px;
}

/* Password Strength */
.password-strength {
    margin-top: 10px;
}

.strength-bar {
    height: 4px;
    background: rgba(60, 60, 60, 0.8);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 5px;
}

.strength-fill {
    height: 100%;
    width: 0;
    background: var(--gradient-lava);
    border-radius: 2px;
    transition: var(--transition-normal);
}

.strength-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.strength-text.weak { color: #ff4444; }
.strength-text.fair { color: #ff8800; }
.strength-text.good { color: #ffcc00; }
.strength-text.strong { color: #44ff44; }

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(139, 0, 0, 0.5);
    border-radius: 4px;
    position: relative;
    transition: var(--transition-fast);
}

.checkbox-container:hover .checkmark {
    border-color: var(--fire-middle);
}

.checkbox-container input:checked + .checkmark {
    background: var(--gradient-lava);
    border-color: transparent;
}

.checkbox-container input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Links */
.forgot-link,
.terms-link {
    color: var(--fire-middle);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.forgot-link:hover,
.terms-link:hover {
    color: var(--text-fire);
    text-shadow: 0 0 10px rgba(255, 123, 0, 0.5);
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 16px 30px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-primary);
    background: var(--gradient-lava);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-fire);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 0 40px rgba(255, 69, 0, 0.6),
        0 0 80px rgba(255, 123, 0, 0.4);
}

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

.submit-btn::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: 0.5s;
}

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

.btn-text {
    position: relative;
    z-index: 2;
}

.btn-loader {
    display: none;
    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;
}

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

.submit-btn.loading .btn-loader {
    display: inline-block;
}

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

/* Error & Success Messages */
.form-error,
.form-success {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.form-error {
    background: rgba(139, 0, 0, 0.3);
    border: 1px solid rgba(220, 20, 60, 0.5);
    color: #ff6b6b;
}

.form-error.show,
.form-success.show {
    display: block;
    animation: shakeError 0.5s ease;
}

.form-success {
    background: rgba(0, 100, 0, 0.3);
    border: 1px solid rgba(0, 200, 0, 0.5);
    color: #6bff6b;
}

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

/* =====================================================
   MODAL
   ===================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(30, 30, 30, 0.95);
    border: 2px solid rgba(139, 0, 0, 0.5);
    border-radius: var(--border-radius-lg);
    padding: 50px 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: scale(0.8);
    transition: var(--transition-normal);
    box-shadow: var(--shadow-fire);
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    background: var(--gradient-lava);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalPulse 2s ease-in-out infinite;
}

.modal-icon svg {
    width: 40px;
    height: 40px;
    stroke: white;
}

@keyframes modalPulse {
    0%, 100% {
        box-shadow: 0 0 30px rgba(255, 69, 0, 0.6);
    }
    50% {
        box-shadow: 0 0 60px rgba(255, 123, 0, 0.8);
    }
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--text-fire);
    margin-bottom: 15px;
}

.modal-message {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.modal-btn {
    padding: 14px 40px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: var(--gradient-lava);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-fire);
}

.modal-btn:hover {
    transform: scale(1.05);
    box-shadow: 
        0 0 40px rgba(255, 69, 0, 0.6),
        0 0 80px rgba(255, 123, 0, 0.4);
}

/* =====================================================
   FOOTER
   ===================================================== */
.footer {
    text-align: center;
    padding: 30px 20px;
}

.copyright {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--fire-middle);
}

/* =====================================================
   EMBER PARTICLES
   ===================================================== */
.ember {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, var(--fire-inner) 0%, var(--fire-outer) 50%, transparent 100%);
    border-radius: 50%;
    animation: emberFloat 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes emberFloat {
    0% {
        transform: translateY(100vh) translateX(0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-20vh) translateX(50px) scale(0);
        opacity: 0;
    }
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */

/* Tablet */
@media (max-width: 768px) {
    :root {
        --auth-max: 400px;
    }
    
    .logo {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }
    
    .tagline {
        font-size: 1rem;
        letter-spacing: 0.3em;
    }
    
    .auth-form {
        padding: 30px 25px;
    }
    
    .form-title {
        font-size: 1.5rem;
    }
    
    .tab-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .tab-icon {
        width: 16px;
        height: 16px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .main-container {
        padding: 15px;
    }
    
    .header {
        padding: 25px 10px;
    }
    
    .logo {
        font-size: clamp(2rem, 15vw, 3rem);
    }
    
    .tagline {
        font-size: 0.8rem;
        letter-spacing: 0.2em;
    }
    
    .tab-container {
        width: 100%;
    }
    
    .tab-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 15px;
        font-size: 0.85rem;
    }
    
    .tab-btn span {
        display: none;
    }
    
    .tab-btn .tab-icon {
        display: block;
    }
    
    @media (min-width: 350px) {
        .tab-btn span {
            display: inline;
        }
    }
    
    .auth-form {
        padding: 25px 20px;
    }
    
    .form-title {
        font-size: 1.3rem;
    }
    
    .form-subtitle {
        font-size: 0.85rem;
    }
    
    .form-input {
        padding: 12px 14px;
        font-size: 0.95rem;
    }
    
    .submit-btn {
        padding: 14px 25px;
        font-size: 1rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .modal-content {
        padding: 35px 25px;
    }
    
    .modal-icon {
        width: 60px;
        height: 60px;
    }
    
    .modal-icon svg {
        width: 30px;
        height: 30px;
    }
    
    .modal-title {
        font-size: 1.4rem;
    }
    
    .footer-links {
        gap: 15px;
    }
}

/* Extra Small */
@media (max-width: 320px) {
    .auth-form {
        padding: 20px 15px;
    }
    
    .form-label {
        font-size: 0.8rem;
    }
    
    .form-input {
        padding: 10px 12px;
    }
}

/* Landscape Mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .header {
        padding: 15px 10px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .tagline {
        display: none;
    }
    
    .auth-container {
        padding: 10px 0;
    }
    
    .auth-form {
        padding: 20px;
    }
    
    .form-header {
        margin-bottom: 15px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .form-input,
    .submit-btn {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Reduce Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
