/* ============================================
   HEXED - Base Stylesheet
   Core styles extracted from base.html and common patterns
   ============================================ */

/* ============================================
   FONTS
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Crimson+Text:ital,wght@0,400;0,600;1,400&family=Macondo&family=Quintessential&family=Uncial+Antiqua&family=Spectral:wght@700;800&family=Lora:ital,wght@0,400;0,600;1,400&display=swap');

/* ============================================
   CSS RESET
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   CSS VARIABLES (COLOR PALETTE)
   ============================================ */
:root {
    /* Deep blacks and shadows */
    --obsidian: #0d0a0a;
    --charcoal: #1a1414;
    --soot: #252020;
    
    /* Reds - wax and fire */
    --blood-red: #8B0000;
    --wax-red: #a01a1a;
    --ember: #d63a2e;
    --rust: #6b2424;
    
    /* Earth tones */
    --copal: #f5e6d3;
    --bone: #ede5d8;
    --clay: #8b7355;
    --dried-herbs: #5a5040;
    
    /* Accent colors */
    --marigold: #ff9500;
    --fire-gold: #ffb347;
    --sage: #9CAF88;
    --desert-sage: #b4c29d;

    /* High contrast text */
    --text-white: #FFFFFF;
    --text-cream: #FFF8DC;
    --text-silver: #F5F5F5;
    --text-light: #E8E8E8;
    --text-medium: #D1D1D1;
    --text-muted: #B8B8B8;

    /* Gold tones */
    --gold-bright: #FFD700;
    --gold-warm: #FFC947;
    --gold-rich: #FFBF00;
    --amber: #FFBF00;

    /* Orange/Fire tones */
    --flame-bright: #FF6B35;
    --ember-glow: #FF8C42;
    --fire-orange: #FF9500;
}

/* ============================================
   BODY & BACKGROUND
   ============================================ */
body {
    font-family: 'Lora', serif;
    background: radial-gradient(ellipse at center, #2a1f1f 0%, #0d0a0a 60%);
    background-attachment: fixed;
    background-color: black;
    color: var(--copal);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Animated fireplace glow effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 50% 100%, rgba(214, 58, 46, 0.55) 0%, transparent 55%),
        radial-gradient(circle at 30% 80%, rgba(139, 0, 0, 0.45) 0%, transparent 50%),
        radial-gradient(circle at 70% 85%, rgba(255, 179, 71, 0.4) 0%, transparent 45%),
        radial-gradient(circle at 50% 90%, rgba(255, 149, 0, 0.5) 0%, transparent 65%);
    pointer-events: none;
    z-index: 2;
    animation: flicker 4s ease-in-out infinite alternate;
}

/* Subtle smoke/copal effect */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(180, 194, 157, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 50%, rgba(90, 80, 64, 0.06) 0%, transparent 40%);
    pointer-events: none;
    z-index: 1;
    animation: smoke 8s ease-in-out infinite alternate;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes flicker {
    0%, 100% { opacity: 1; }
    25% { opacity: 0.85; }
    50% { opacity: 0.95; }
    75% { opacity: 0.9; }
}

@keyframes smoke {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-10px) scale(1.02); opacity: 0.7; }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rise {
    0% {
        transform: translateY(0) scale(0.6);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-110vh) scale(1.2);
        opacity: 0;
    }
}

@keyframes subtleGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.05); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3 {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 
        0 0 20px rgba(214, 58, 46, 0.6),
        0 0 40px rgba(139, 0, 0, 0.4),
        2px 2px 4px rgba(0, 0, 0, 0.8);
}

h4 {
    font-family: "Uncial Antiqua", system-ui;
    font-weight: 400;    
    letter-spacing: 3px;
    text-shadow: 
        0 0 15px rgba(255, 179, 71, 0.5),
        2px 2px 6px rgba(0, 0, 0, 0.7);
}

h1 {
    font-size: 3rem;
    color: var(--copal);
    margin-bottom: 10px;
    filter: drop-shadow(0 0 10px rgba(255, 148, 0, 0.3));
}

h2 {
    font-size: 1.8rem;
    color: var(--fire-gold);
    margin-bottom: 20px;
}

a {
    text-decoration: none;
    color: var(--fire-gold);
}

/* Typography utility classes */
.quint {
    font-family: "Quintessential", serif;
    font-weight: 400;
    font-style: normal;
}

.macondo {
    font-family: "Macondo", cursive;
    font-weight: 400;
    font-style: normal;
}

.spectral {
    font-family: 'Spectral', serif;
    font-weight: 800;
}

.fade-in {
    animation: fadeIn 0.8s ease-out;
}

.tagline {
    font-style: italic;
    font-size: 1.3rem;
    color: var(--desert-sage);
    margin-bottom: 30px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* ============================================
   LAYOUT CONTAINERS
   ============================================ */
.container {
    position: relative;
    z-index: 2;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.mini-container {
    position: relative;
    z-index: 2;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* ============================================
   GLOBAL HEADER
   ============================================ */
.global-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(180deg, 
        rgba(13, 10, 10, 0.98) 0%, 
        rgba(26, 20, 20, 0.95) 100%);
    border-bottom: 2px solid var(--ember);
    padding: 15px 20px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.8),
        0 2px 40px rgba(214, 58, 46, 0.3);
}

.global-header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.global-header-logo {
    font-family: 'Cinzel', serif;
    text-align: center;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--copal);
    text-transform: uppercase;
    letter-spacing: 3px;
    text-decoration: none;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 10px rgba(255, 148, 0, 0.3));
    text-shadow: 
        0 0 20px rgba(214, 58, 46, 0.6),
        0 0 40px rgba(139, 0, 0, 0.4),
        2px 2px 4px rgba(0, 0, 0, 0.8);
}

.global-header-logo:hover {
    color: var(--ember);
    text-shadow: 0 0 20px rgba(255, 148, 0, 0.6);
}

.global-header-back {
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--soot) 0%, var(--charcoal) 100%);
    border: 1px solid var(--clay);
    color: var(--desert-sage);
    border-radius: 3px;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.global-header-back:hover {
    background: linear-gradient(135deg, var(--sage) 0%, var(--desert-sage) 100%);
    color: var(--obsidian);
    border-color: var(--sage);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 15px 40px;
    border: 2px solid var(--ember);
    background: linear-gradient(135deg, var(--rust) 0%, var(--wax-red) 50%, var(--blood-red) 100%);
    color: var(--copal);
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(139, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 20px rgba(214, 58, 46, 0.3);
    font-size: 1rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    border-radius: 3px;
}

.btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    height: 4px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 179, 71, 0.4) 50%, 
        transparent 100%);
    filter: blur(2px);
}

.btn:hover {
    background: linear-gradient(135deg, var(--blood-red) 0%, var(--ember) 50%, var(--fire-gold) 100%);
    border-color: var(--fire-gold);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 25px rgba(255, 148, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 30px rgba(214, 58, 46, 0.6);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--soot) 0%, var(--charcoal) 100%);
    border-color: var(--desert-sage);
    color: var(--desert-sage);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(156, 175, 136, 0.1);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--sage) 0%, var(--desert-sage) 100%);
    color: var(--obsidian);
    border-color: var(--desert-sage);
    box-shadow: 
        0 6px 20px rgba(156, 175, 136, 0.4),
        0 0 25px rgba(180, 194, 157, 0.3);
}

.btn-back {
    background: linear-gradient(135deg, var(--soot) 0%, var(--charcoal) 100%);
    border-color: var(--clay);
    color: var(--desert-sage);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(156, 175, 136, 0.1);
}

.btn-back:hover {
    border-color: var(--desert-sage);
    background: linear-gradient(135deg, var(--sage) 0%, var(--desert-sage) 100%);
    color: var(--obsidian);
    box-shadow: 
        0 6px 20px rgba(156, 175, 136, 0.4),
        0 0 25px rgba(180, 194, 157, 0.3);
}

/* ============================================
   FORM INPUTS
   ============================================ */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px 15px;
    margin: 10px 0;
    background: linear-gradient(135deg, var(--obsidian) 0%, var(--charcoal) 100%);
    border: 1px solid var(--dried-herbs);
    border-left: 3px solid var(--rust);
    color: var(--copal);
    font-family: 'Crimson Text', serif;
    font-size: 1.1rem;
    border-radius: 3px;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

textarea {
    min-height: 150px;
    resize: vertical;
    line-height: 1.6;
}

select {
    padding: 15px;
    cursor: pointer;
}

select option {
    background: var(--charcoal);
    color: var(--copal);
    padding: 10px;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--ember);
    border-left-color: var(--fire-gold);
    background: linear-gradient(135deg, var(--charcoal) 0%, var(--soot) 100%);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(214, 58, 46, 0.3),
        0 0 5px rgba(255, 148, 0, 0.2);
}

label {
    display: block;
    margin-top: 15px;
    color: var(--desert-sage);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    margin: 20px 0;
    gap: 10px;
}

.checkbox-container input[type="checkbox"] {
    width: auto;
    margin-top: 5px;
    cursor: pointer;
    accent-color: var(--ember);
}

.checkbox-container label {
    margin: 0;
    text-transform: none;
    font-size: 0.95rem;
    cursor: pointer;
}

/* ============================================
   MESSAGES
   ============================================ */
.messages {
    position: relative;
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.messages li {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 3px;
    border-left: 4px solid;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.4) 0%, transparent 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.messages .error {
    background: linear-gradient(90deg, rgba(139, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.2) 100%);
    border-color: var(--ember);
    color: var(--copal);
    box-shadow: 0 2px 8px rgba(139, 0, 0, 0.4);
}

.messages .success {
    background: linear-gradient(90deg, rgba(156, 175, 136, 0.3) 0%, rgba(0, 0, 0, 0.2) 100%);
    border-color: var(--desert-sage);
    color: var(--copal);
    box-shadow: 0 2px 8px rgba(156, 175, 136, 0.3);
}

.close-btn {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    z-index: 10;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.close-btn:hover {
    opacity: 1;
    color: var(--desert-sage);
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}

/* ============================================
   DECORATIVE ELEMENTS
   ============================================ */
.floral-divider {
    text-align: center;
    margin: 30px 0;
    color: var(--ember);
    font-size: 1.5rem;
    filter: drop-shadow(0 0 5px rgba(255, 148, 0, 0.2));
}

/* Floating embers */
.embers {
    z-index: 3;
}

.ember {
    position: fixed;
    bottom: -10px;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, var(--fire-gold) 0%, rgba(255,179,71,0.3) 70%, transparent 100%);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    animation: rise 6s linear infinite;
    box-shadow: 0 0 10px var(--ember);
}

.ember:nth-child(odd) {
    filter: blur(1px);
    width: 3px;
    height: 3px;
}

.ember:nth-child(even) {
    filter: blur(2px);
    width: 5px;
    height: 5px;
}

/* Firelight glow on interactive elements */
.btn, input, textarea, select {
    animation: subtleGlow 3s ease-in-out infinite alternate;
}

/* ============================================
   FOOTER
   ============================================ */
.landing-footer {
    padding: 40px 20px;
    text-align: center;
    border-top: 1px solid var(--rust);
    color: var(--copal);
    font-size: 0.9rem;
    max-width: 700px;
    margin: 0 auto;
}

.footer-links {
    margin-bottom: 20px;
}

.footer-links a {
    color: var(--fire-gold);
    text-decoration: none;
    margin: 0 15px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--fire-gold);
}

/* ============================================
   FLOATING HELP BUTTON
   ============================================ */
.floating-help-btn {                
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #7B0D0D 0%, #A01A1A 100%);
    border: 2px solid var(--ember);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fire-gold);
    font-size: 1.3rem;
    text-decoration: none;
    box-shadow: 
        0 4px 20px rgba(139, 0, 0, 0.6),
        0 0 30px rgba(214, 58, 46, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
}

.floating-help-btn::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 179, 71, 0.6) 50%, 
        transparent 100%);
    border-radius: 2px;
    filter: blur(2px);
}

.floating-help-btn:hover {
    transform: translateY(-3px) scale(1.05);
    background: linear-gradient(135deg, var(--blood-red) 0%, var(--ember) 100%);
    box-shadow: 
        0 6px 30px rgba(214, 58, 46, 0.8),
        0 0 50px rgba(255, 179, 71, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.floating-help-btn i {
    animation: helpPulse 2s ease-in-out infinite;
}

@keyframes helpPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ============================================
   MOBILE BOTTOM NAVIGATION
   ============================================ */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, 
        rgba(13, 10, 10, 0.98) 0%, 
        rgba(26, 20, 20, 0.98) 100%);
    border-top: 2px solid var(--ember);
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 
        0 -4px 20px rgba(0, 0, 0, 0.8),
        0 -2px 40px rgba(214, 58, 46, 0.3),
        inset 0 1px 0 rgba(255, 179, 71, 0.1);
}

.mobile-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 10px;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    color: var(--desert-sage);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 8px;
    min-width: 60px;
    position: relative;
}

.mobile-nav-item i {
    font-size: 1.4rem;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.mobile-nav-item span {
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Cinzel', serif;
    font-weight: 600;
}

.mobile-nav-item:active {
    transform: scale(0.95);
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    color: var(--fire-gold);
}

.mobile-nav-item:hover i,
.mobile-nav-item.active i {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 8px rgba(255, 179, 71, 0.8));
}

/* Active indicator */
.mobile-nav-item.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--fire-gold) 50%, 
        transparent 100%);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255, 179, 71, 0.8);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .mobile-nav {
        display: block;
    }

    .container {
        padding-bottom: 80px;
    }

    .landing-footer {
        padding-bottom: 80px;
    }

    .global-header-logo {
        font-size: 1.2rem;
        letter-spacing: 2px;
    }

    .global-header-back {
        font-size: 0.7rem;
        padding: 6px 12px;
    }

    .floating-help-btn {
        width: 33px;
        height: 33px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .mobile-nav-item {
        min-width: 50px;
        padding: 6px 8px;
    }

    .mobile-nav-item i {
        font-size: 1.2rem;
    }

    .mobile-nav-item span {
        font-size: 0.65rem;
    }

    .global-header {
        padding: 12px 15px;
    }

    .global-header-logo {
        font-size: 1.1rem;
    }
}