/* ==========================================================
   2. GLOBAL VARIABLES & BASE STYLES (base.css)
   ========================================================== */

:root {
    /* =========================================
       CORE PALETTE (Immutable)
       ========================================= */
    --p-sky-blue: #0ea5e9;
    --p-teal: #14b8a6;
    --p-white: #ffffff;

    /* Layout */
    --header-height: 80px;
    --container-padding: clamp(1rem, 5vw, 2rem);
    --border-radius-btn: 12px;
    --glass-blur: blur(12px);

    /* =========================================
       LIGHT THEME (Default)
       ========================================= */

    /* Backgrounds */
    --bg-main: linear-gradient(145deg, #f8fcff 0%, #f1fbff 100%);
    --bg-surface: rgba(255, 255, 255, 0.85);
    --bg-header: linear-gradient(135deg, var(--p-sky-blue), var(--p-teal));
    --bg-input: #ffffff;

    /* Text */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-header: #ffffff;

    /* Borders */
    --border-subtle: rgba(14, 165, 233, 0.15);

    /* Accents */
    --sky-blue: var(--p-sky-blue);
    --teal: var(--p-teal);
    --white: var(--p-white);

    /* Shadows */
    --shadow-card: 0 10px 25px -5px rgba(14, 165, 233, 0.1), 0 8px 10px -6px rgba(14, 165, 233, 0.05);
}

/* =========================================
   DARK THEME (Midnight)
   ========================================= */
[data-theme="dark"] {
    /* Backgrounds */
    --bg-main: #0b1121;
    /* Solid deep midnight */
    --bg-surface: #1e293b;
    /* Solid slate, no opacity */
    --bg-header: #1e293b;
    --bg-input: #0f172a;

    /* Text */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-header: #f1f5f9;

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.12);

    /* Accents */
    --sky-blue: #38bdf8;
    --teal: #2dd4bf;

    /* Shadows */
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    :root {
        --header-height: 70px;
        --container-padding: 16px;
    }
}

/* ----------------------------------------------------------
   RESET & FUNDAMENTALS
   ---------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box !important;
}

html,
body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    position: relative;
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
    /* Critical for mobile to prevent sway */
    /* Prevent font inflation on mobile */
    -webkit-text-size-adjust: 100%;

    /* Global Alignment Lockdown */
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100vw;
}

@media (max-width: 768px) {

    /* Prevent iOS Zoom on focus */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

html {
    scroll-padding-top: var(--header-height);
}

body {
    padding-top: var(--header-height);
    line-height: 1.6;
}

/* Headings Upgrade */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    /* Dynamic scaling */
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

p {
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* Base Link Styles */
a {
    color: var(--sky-blue);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--teal);
}

a:active,
button:active {
    transform: scale(0.96);
    opacity: 0.8;
}

/* Responsive Images */
img,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ----------------------------------------------------------
   GLOBAL ANIMATIONS
   ---------------------------------------------------------- */
@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

@keyframes floatGlow {
    0% {
        transform: translateY(0);
        opacity: 0.7;
    }

    100% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

@keyframes floatGlowAuth {
    0% {
        opacity: 0.7;
        transform: translateY(0);
    }

    100% {
        opacity: 1;
        transform: translateY(-10px);
    }
}

@keyframes fadeSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes subtleFloat {
    0% {
        transform: translateY(0);
        opacity: 0.7;
    }

    100% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

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

@keyframes gradientMove {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(14, 165, 233, 0.4);
    }

    50% {
        box-shadow: 0 0 35px rgba(14, 165, 233, 0.8);
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Utility: Hidden */
.hidden {
    display: none !important;
}

/* Footer Centering */
footer,
.footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}