:root {
    --color-bg-dark: #0B1220;
    --color-bg-dark-alt: #111C30;
    --color-accent: #3B82F6;
    --color-accent-hover: #2563EB;
    --color-cyan: #22D3EE;
    --color-accent-blue: #38BDF8;
    --color-bg: #ffffff;
    --color-bg-muted: #F8FAFC;
    --color-border: #1E2A42;
    --color-border-light: #E2E8F0;
    --color-heading: #172B4D;
    --color-text: #172B4D;
    --color-text-body: #334155;
    --color-text-muted: #64748B;
    --color-text-inverted: #F8FAFC;
    --color-text-inverted-muted: rgba(248, 250, 252, 0.78);
    --color-nav-link: #E2E8F0;
    --color-cta-bg: #2563EB;
    --color-cta-bg-hover: #1D4ED8;
    --radius-md: 10px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(11, 18, 32, 0.06), 0 1px 3px rgba(11, 18, 32, 0.08);
    --shadow-md: 0 8px 20px rgba(11, 18, 32, 0.10), 0 2px 6px rgba(11, 18, 32, 0.06);
    --shadow-lg: 0 24px 48px rgba(11, 18, 32, 0.35);
    --container-max: 1200px;
    --font-heading: 'Manrope', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --font-size-hero: 2.5rem;
    --font-size-section: 1.875rem;
    --font-size-card: 1.4375rem;
    --font-size-body: 1rem;
    --font-size-nav: 0.9375rem;
    --line-height-heading: 1.25;
    --line-height-body: 1.75;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--color-bg-muted);
    color: var(--color-text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: var(--line-height-heading);
    color: var(--color-heading);
    letter-spacing: -0.015em;
}

p {
    font-family: var(--font-body);
    font-size: var(--font-size-body);
    line-height: var(--line-height-body);
    color: var(--color-text-body);
}

/* ---------- Header / Navigation ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 18, 32, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem;
    gap: 1.5rem;
}

.logo {
    color: var(--color-text-inverted);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.3125rem;
    text-decoration: none;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.logo span {
    font-weight: 500;
    color: var(--color-accent-blue);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-left: auto;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1.9rem;
    margin: 0;
    padding: 0;
}

.main-nav a {
    font-family: var(--font-body);
    color: var(--color-nav-link);
    text-decoration: none;
    font-size: var(--font-size-nav);
    font-weight: 500;
    transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
    color: var(--color-accent-blue);
    outline: none;
}

.btn-nav-cta {
    margin-left: 1.5rem;
    white-space: nowrap;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    background: transparent;
    cursor: pointer;
}

.nav-toggle__bar {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    background: var(--color-text-inverted);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.is-active .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-active .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Main layout ---------- */

main.container {
    min-height: 60vh;
    padding-top: 0;
    padding-bottom: 5rem;
}

.page-title {
    font-size: var(--font-size-section);
    margin: 3rem 0 2.5rem;
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 30vh;
    background:
        radial-gradient(circle at 15% 10%, rgba(59, 130, 246, 0.28), transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(34, 211, 238, 0.16), transparent 55%),
        linear-gradient(180deg, var(--color-bg-dark) 0%, var(--color-bg-dark-alt) 100%);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        radial-gradient(circle at 15% 10%, rgba(59, 130, 246, 0.28), transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(34, 211, 238, 0.16), transparent 55%),
        linear-gradient(180deg, var(--color-bg-dark) 0%, var(--color-bg-dark-alt) 100%);
    background-size: 36px 36px, 36px 36px, auto, auto, auto;
    padding: 3.25rem 2rem;
    margin: 0 0 3rem;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hero__inner {
    max-width: 680px;
    margin: 0 auto;
}

.hero h1 {
    color: var(--color-text-inverted);
    font-weight: 700;
    font-size: clamp(1.75rem, 4vw, var(--font-size-hero));
    line-height: var(--line-height-heading);
    max-width: 20ch;
    margin: 0 auto 1.25rem;
}

.hero h1 .hero__brand,
.hero__subtitle .hero__brand {
    color: var(--color-accent-blue);
    font-weight: 700;
}

.hero__subtitle {
    color: var(--color-text-inverted);
    font-size: clamp(1.375rem, 2.1vw, 1.625rem);
    font-weight: 600;
    line-height: 1.5;
    margin: 0 auto;
    max-width: 44ch;
}

/* ---------- Sections / Cards ---------- */

.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.75rem;
}

.card,
.page-section {
    background: #fff;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.card:hover,
.page-section:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(59, 130, 246, 0.35);
    transform: translateY(-3px);
}

.page-section h2 {
    font-size: var(--font-size-card);
    font-weight: 700;
    line-height: var(--line-height-heading);
    margin-top: 0;
    margin-bottom: 1.75rem;
    position: relative;
    padding-left: 1rem;
}

.page-section h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.2em;
    bottom: 0.2em;
    width: 3px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--color-accent), var(--color-cyan));
}

/* ---------- CMS content ---------- */

.cms-content h1,
.cms-content h2,
.cms-content h3 {
    color: var(--color-text);
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    line-height: var(--line-height-heading);
}

.cms-content h1 { font-size: var(--font-size-section); }
.cms-content h2 { font-size: var(--font-size-card); }
.cms-content h3 { font-size: 1.25rem; }

.cms-content h1:first-child,
.cms-content h2:first-child,
.cms-content h3:first-child,
.cms-content p:first-child {
    margin-top: 0;
}

.cms-content p {
    font-family: var(--font-body);
    font-size: var(--font-size-body);
    line-height: var(--line-height-body);
    color: var(--color-text-body);
    margin: 0 0 1.1rem;
}

.cms-content ul,
.cms-content ol {
    margin: 0 0 1.1rem;
    padding-left: 1.5rem;
    color: var(--color-text-body);
}

.cms-content li {
    margin-bottom: 0.5rem;
    line-height: 1.75;
}

.cms-content a {
    color: var(--color-accent-hover);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cms-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 3px solid var(--color-accent);
    background: var(--color-bg-muted);
    color: var(--color-text-muted);
    font-style: italic;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.cms-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--font-size-nav);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
    background: var(--color-cta-bg);
    color: #FFFFFF;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: var(--color-cta-bg-hover);
    transform: translateY(-1px);
    outline: none;
}

.btn-danger {
    background: #d9534f;
    color: #fff;
}

.btn-dark-blue {
    background: #1e3a5f;
    color: #fff;
}

.btn-dark-blue:hover,
.btn-dark-blue:focus-visible {
    background: #152a45;
    outline: none;
}

.section-heading-dark-green {
    color: #14532d;
}

/* ---------- Footer ---------- */

.site-footer {
    background: var(--color-bg-dark);
    color: var(--color-text-inverted-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    padding: 3.5rem 1.5rem 2.5rem;
}

.site-footer .logo {
    color: #fff;
}

.site-footer .logo span {
    color: var(--color-accent-blue);
}

.site-footer__brand p {
    margin: 0.75rem 0 0;
    font-size: 0.9rem;
    max-width: 320px;
}

.site-footer__links {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.site-footer__links a {
    color: var(--color-text-inverted-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.site-footer__links a:hover,
.site-footer__links a:focus-visible {
    color: var(--color-accent-blue);
    outline: none;
}

.site-footer__bottom {
    border-top: 1px solid rgba(248, 250, 252, 0.08);
    padding: 1.25rem 1.5rem;
    text-align: center;
    font-size: 0.85rem;
}

.site-footer__bottom p {
    margin: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
    .nav-toggle {
        display: flex;
    }

    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: var(--color-bg-dark-alt);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: var(--shadow-lg);
        padding: 1.25rem 1.5rem;
        gap: 1.25rem;
        display: none;
    }

    .main-nav.is-open {
        display: flex;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    .site-header__inner {
        position: relative;
    }

    .btn-nav-cta {
        display: none;
    }

    .hero {
        min-height: 26vh;
        padding: 2.75rem 1.25rem;
    }

    .hero h1 {
        font-size: 2rem;
        max-width: 18ch;
    }

    .hero__subtitle {
        font-size: 1.375rem;
        max-width: 38ch;
    }

    .site-footer__inner {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 1.5rem;
    }

    .hero {
        min-height: auto;
        padding: 2.25rem 1.25rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .page-section h2,
    .cms-content h2 {
        font-size: 1.3125rem;
    }

    .hero__subtitle {
        font-size: 1.15rem;
        max-width: 32ch;
    }
}

/* Admin panel */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 220px;
    background: var(--color-bg-dark);
    color: #fff;
    padding: 20px;
}

.admin-sidebar a {
    color: #fff;
    display: block;
    padding: 8px 0;
    text-decoration: none;
}

.admin-content {
    flex: 1;
    padding: 30px;
}

table.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

table.admin-table th,
table.admin-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.alert {
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.alert-error {
    background: #fde2e2;
    color: #7a1c1c;
}

.alert-success {
    background: #e0f5e9;
    color: #1c6b3a;
}
