/* =========================================
   1. CORE VARIABLES & RESET
   ========================================= */
:root {
    /* Brand Colors */
    --primary-green: #2ECC71;
    --primary-blue: #0A3D62;
    --dark-bg: #0f172a;
    /* Form Background */

    /* Report/Index2 Colors */
    --report-bg: #082f4e;
    --report-card: #0A3D62;
    --report-text: #f5f5f5;
    --report-text-sec: #c0d6e4;
    --level-bad: #E74C3C;
    --level-mid: #F39C12;
    --level-good: #2ECC71;

    /* Glassmorphism (Form Only) */
    --card-bg-glass: rgba(30, 41, 59, 0.7);
    --border-glass: rgba(148, 163, 184, 0.2);
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', 'Inter', sans-serif;
    /* Roboto for body/form */
    background: linear-gradient(135deg, #0f172a 0%, #0A3D62 100%);
    color: #f1f5f9;
    min-height: 100vh;
}

/* =========================================
   2. FORM SECTION (Glassmorphism)
   ========================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    position: relative;
    /* Ensure z-index works */
    z-index: 10;
    /* Place above background effects */
}

/* Header (Form) */
header.form-header {
    text-align: center;
    margin-bottom: 3rem;
}

header.form-header img {
    max-width: 250px;
    height: auto;
    margin-bottom: 1rem;
}

header.form-header h1 {
    font-size: 2rem;
    font-weight: 700;
    /* Gradient Text */
    background: linear-gradient(to right, var(--primary-green), #ffffff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

/* Glass Card */
.glass-card {
    background: var(--card-bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .glass-card {
        background: #1e293b;
        /* Solid fallback */
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
    }
}

/* Form Elements */
.form-section {
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 2rem;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h2 {
    color: var(--primary-green);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #e2e8f0;
}

/* General Input Styling - Enforcing Colors */
input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #0f172a !important;
    /* Opaque dark background */
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: #ffffff !important;
    /* Force white text */
    font-size: 1rem;
    transition: all 0.3s ease;
    appearance: none;
    /* Remove default mobile styling */
    -webkit-appearance: none;
    position: relative;
    /* Stacking context */
    z-index: 20;
    /* Ensure interactivity */
}

/* Checkboxes and Radios containers */
.option-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(15, 23, 42, 0.6);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-glass);
    cursor: pointer;
    transition: all 0.2s;
    color: #ffffff;
    /* Ensure label text is white */
}

/* Focus States */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.2);
    background-color: #0f172a !important;
    color: #ffffff !important;
}

/* Select specific fixes */
select {
    appearance: none;
    /* Remove default arrow if needed, but Tailwind adds one */
    /* If using Tailwind forms, it handles the icon. If not, we might need one. 
       Usually better to let browser handle or Tailwind handle. 
       We just ensure colors are correct. */
    background-image: none;
    /* Reset if necessary, but keep if tailored */
}

/* Options in dropdown */
select option {
    background-color: #0f172a !important;
    color: #ffffff !important;
}

/* Checkbox/Radio Items Hover */
.option-item:hover {
    border-color: var(--primary-green);
    background-color: rgba(15, 23, 42, 0.8);
}

/* Highlight selected options (using :has if available, fallback to nothing specific besides accent) */
/* Note: :has is supported in most modern browsers (Chrome 105+, Safari 15.4+, Edge 105+, Firefox 121+) */
label.option-item:has(input:checked) {
    border-color: var(--primary-green);
    background-color: rgba(46, 204, 113, 0.1);
}

.checkbox-group,
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--primary-green);
    width: 1.2rem;
    height: 1.2rem;
    position: relative;
    z-index: 20;
    cursor: pointer;
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-green) 0%, #27ae60 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

/* =========================================
   3. LOADING SCREEN
   ========================================= */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--dark-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-family: 'Teko', sans-serif;
    color: #f8f9fa;
    overflow: hidden;
}

.gears-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.15;
    overflow: hidden;
    pointer-events: none;
}

.gear {
    position: absolute;
    fill: #adb5bd;
    filter: drop-shadow(2px 2px 2px #495057);
}

@media (max-width: 768px) {
    .gear {
        filter: none;
        /* Disable shadow on mobile for performance */
    }
}

#gear1 {
    top: 10%;
    left: 5%;
    width: 200px;
    animation: spin-clockwise 20s linear infinite;
}

#gear2 {
    top: 40%;
    right: -50px;
    width: 300px;
    animation: spin-counter-clockwise 30s linear infinite;
}

#gear3 {
    bottom: -80px;
    left: 25%;
    width: 400px;
    animation: spin-clockwise 25s linear infinite;
}

@keyframes spin-clockwise {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes spin-counter-clockwise {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(-360deg);
    }
}

.loading-content {
    position: relative;
    z-index: 2;
    background-color: rgba(33, 37, 41, 0.9);
    padding: 40px;
    border-radius: 10px;
    border: 2px solid var(--primary-green);
    text-align: center;
}

.loading-header {
    border-bottom: 4px dashed var(--primary-green);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.loading-title {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 4rem;
    color: var(--primary-green);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.loading-slogan {
    font-size: 1.8rem;
    margin: 10px 0 0 0;
    color: #f8f9fa;
    font-weight: 400;
}

.loading-status {
    font-size: 2.5rem;
    margin-top: 20px;
    font-weight: 700;
    background: repeating-linear-gradient(45deg,
            var(--primary-green),
            var(--primary-green) 15px,
            var(--dark-bg) 15px,
            var(--dark-bg) 30px);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: move-stripes 1s linear infinite;
}

@keyframes move-stripes {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 42px 0;
    }
}

/* =========================================
   4. REPORT SECTION
   ========================================= */
/* Ensure report looks correct and PDF logic works (if any) */
#report-section {
    display: none;
    background-color: var(--report-bg);
    font-family: 'Poppins', sans-serif;
    color: var(--report-text);
    padding: 20px;
    animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}