/* ===============
   CSS VARIABLES – Light (default)
   =============== */
:root {
    --primary-color: #2563eb;
    --secondary-color: #0f172a;
    --accent-color: #16a34a;
    --bg-color: #f3f4f6;
    --surface-color: #ffffff;
    --text-color: #0f172a;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --hover-overlay: rgba(37, 99, 235, 0.04);
    --transition-speed: 0.2s;
    --radius-lg: 18px;
    --radius-md: 12px;
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.08);
    --font-heading: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ===============
   DARK THEME
   =============== */
[data-theme="dark"] {
    --primary-color: #60a5fa;
    --secondary-color: #f1f5f9;
    --accent-color: #4ade80;
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --text-color: #e2e8f0;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --hover-overlay: rgba(96, 165, 250, 0.1);
    --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.35);
}

/* ===============
   RESET
   =============== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

html,
body {
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Light: website background */
body {
    background-color: #eef1f5;
    background-image:
        radial-gradient(ellipse 80% 50% at 15% 20%, rgba(37, 99, 235, 0.07) 0%, transparent 50%),
        radial-gradient(ellipse 70% 40% at 88% 85%, rgba(22, 163, 74, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 100% 60% at 50% 100%, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 1px 1px, rgba(15, 23, 42, 0.045) 1px, transparent 0);
    background-size: 100% 100%, 100% 100%, 100% 100%, 28px 28px;
    background-position: 0 0, 0 0, 0 0, 0 0;
    background-attachment: scroll, scroll, scroll, fixed;
}

/* Dark: website background */
html[data-theme="dark"] body {
    background-color: #0f172a;
    background-image:
        radial-gradient(ellipse 80% 50% at 15% 20%, rgba(96, 165, 250, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 70% 40% at 88% 85%, rgba(74, 222, 128, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 1px 1px, rgba(248, 250, 252, 0.03) 1px, transparent 0);
    background-size: 100% 100%, 100% 100%, 24px 24px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-speed) ease;
}

ul {
    list-style: none;
}

/* ===============
   GLOBAL COMPONENTS
   =============== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===============
   HEADER
   =============== */
.header {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    /* overflow: hidden removed — mobile nav drawer must escape header bounds */
}

.header-inner {
    display: flex;
    align-items: center;
    height: 80px;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: 20px;
}
.logo img {
    height: 48px;
    /*max-height: 48px;*/
    width: auto;
    /*max-width: 180px;*/
    object-fit: contain;
    display: block;
}

.header-nav {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.nav-list {
    display: flex;
    gap: 0;
    align-items: center;
    flex-wrap: nowrap;
}
.nav-list a {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    position: relative;
    padding: 6px 6px;
    border-radius: var(--radius-md);
    letter-spacing: 0.01em;
    color: var(--secondary-color);
    white-space: nowrap;
}
.nav-list a:hover,
.nav-list a.active {
    color: var(--primary-color);
    background: var(--hover-overlay);
}
.nav-list a::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 2px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
    transform: scaleX(0);
    transition: transform var(--transition-speed) ease;
}
.nav-list a:hover::after,
.nav-list a.active::after {
    transform: scaleX(1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    transition: all var(--transition-speed);
}
.btn-login:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: var(--hover-overlay);
}

.btn-signup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: #fff !important;
    padding: 10px 22px;
    border-radius: 999px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.875rem;
    transition: all var(--transition-speed);
}
.btn-signup:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--secondary-color);
    font-size: 1.4rem;
    cursor: pointer;
    transition: all var(--transition-speed);
}
.mobile-menu-toggle:hover {
    background: var(--hover-overlay);
    color: var(--primary-color);
}

/* Theme toggle (dark/light) */
.theme-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.25rem;
    transition: background var(--transition-speed), border-color var(--transition-speed);
}
.theme-toggle:hover {
    background: var(--hover-overlay);
    border-color: var(--primary-color);
}
.theme-toggle-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-icon-dark {
    display: none;
}
.theme-icon-light {
    display: inline-block;
}
html[data-theme="dark"] .theme-icon-light {
    display: none;
}
html[data-theme="dark"] .theme-icon-dark {
    display: inline-block;
}

/* ===============
   ADS BLOCK
   =============== */
.ad-banner-container {
    margin-top: 96px;
    text-align: center;
}

.ad-banner-container img {
    max-width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    border: 1px solid var(--border-color);
}

.ad-banner-container img:hover {
    transform: scale(1.02);
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.14);
}

/* ===============
   FOOTER
   =============== */
.footer {
    background: var(--surface-color);
    padding: 60px 0 24px;
    margin-top: 72px;
    border-top: 1px solid var(--border-color);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 40px;
    margin-bottom: 50px;
}

.footer-col h4 {
    font-family: var(--font-heading);
    font-size: 20px;
    margin-bottom: 25px;
    color: var(--secondary-color);
    text-transform: none;
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-col a {
    color: var(--text-muted);
    font-size: 15px;
}

.footer-col a:hover {
    color: var(--secondary-color);
    padding-left: 4px;
}

.footer-bottom {
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 14px;
}

/* ===============
   RESPONSIVE
   =============== */
@media (max-width: 1300px) {
    /* Hide desktop nav – drawer replaces it */
    .header-nav {
        position: static;
    }

    .nav-list {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 80px; /* matches .header-inner height */
        left: 0;
        width: 100%;
        background: var(--surface-color);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
        padding: 0 16px;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease, padding 0.35s ease;
    }

    .nav-list.active {
        max-height: 500px;
        padding: 16px;
    }

    .nav-list a {
        padding: 14px 16px;
        border-radius: var(--radius-md);
        text-align: left;
        font-size: 0.9rem;
    }

    .nav-list a::after {
        display: none;
    }

    .nav-list a:hover {
        background: var(--hover-overlay);
    }

    .header-actions .btn-login,
    .header-actions .btn-signup {
        padding: 8px 14px;
        font-size: 0.75rem;
    }

    .mobile-menu-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .header-inner {
        height: 64px;
        gap: 8px;
    }

    /* Override top offset for smaller header */
    .nav-list {
        top: 64px;
    }

    .logo {
        margin-right: 0;
    }

    .logo img {
        height: 36px;
        max-width: 130px;
    }

    /* Keep buttons compact and inline */
    .header-actions {
        gap: 6px;
    }

    .header-actions .btn-login,
    .header-actions .btn-signup {
        padding: 7px 12px;
        font-size: 0.72rem;
    }

    /* Shrink theme toggle & hamburger */
    .theme-toggle,
    .mobile-menu-toggle {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .ad-banner-container {
        margin-top: 80px;
    }

    .footer {
        padding: 40px 0 20px;
        margin-top: 40px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
        margin-bottom: 32px;
    }

    .footer-col h4 {
        font-size: 16px;
        margin-bottom: 16px;
    }
}

@media (max-width: 480px) {
    .header-inner {
        height: 60px;
        gap: 6px;
    }

    .nav-list {
        top: 60px;
    }

    .logo img {
        height: 32px;
        max-width: 110px;
    }

    /* On very small phones only keep one button visible to save space */
    .header-actions .btn-login {
        display: none;
    }

    .header-actions .btn-signup {
        padding: 8px 14px;
        font-size: 0.75rem;
    }

    .ad-banner-container {
        margin-top: 72px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ===============
   MOBILE BOTTOM AUTH BAR
   =============== */
.mobile-bottom-auth {
    display: none;
}

@media (max-width: 768px) {
    .mobile-bottom-auth {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: var(--surface-color);
        padding: 12px 16px;
        gap: 12px;
        z-index: 1000;
        box-shadow: 0 -1px 3px rgba(15, 23, 42, 0.06);
        border-top: 1px solid var(--border-color);
    }
    
    .mob-btn-login,
    .mob-btn-signup {
        flex: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 48px;
        font-family: var(--font-heading);
        font-weight: 700;
        font-size: 0.875rem;
        border-radius: 999px;
        letter-spacing: 0.5px;
        text-decoration: none;
        transition: all var(--transition-speed);
    }

    /* Entrar */
    .mob-btn-login {
        color: var(--secondary-color);
        border: 1px solid var(--border-color);
        background: transparent;
    }
    .mob-btn-login:hover {
        color: var(--primary-color);
        border-color: var(--primary-color);
        background: var(--hover-overlay);
    }

    /* Cadastre-se */
    .mob-btn-signup {
        background: var(--primary-color);
        color: #fff !important;
        border: none;
    }
    .mob-btn-signup:hover {
        background: #1d4ed8;
        transform: translateY(-1px);
        box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
    }

    /* hide header buttons strictly on mobile */
    .header-actions .btn-login,
    .header-actions .btn-signup {
        display: none !important;
    }

    /* pad body bottom so it doesn't overlap text/footer */
    body {
        padding-bottom: 75px;
    }
}