/* ========================================
   §86-Finder – Uncodixfy Design System
   Clean, functional, human-designed.
   No gradients, no glass, no hero theater.
   ======================================== */

/* --- Design Tokens --- */
:root {
    --bg: #f9fafb;
    --surface: #ffffff;
    --primary: #1e293b;
    --secondary: #475569;
    --accent: #0f766e;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --hover-bg: #f1f5f9;
    --success-bg: #f0fdf4;
    --success-border: #86efac;
    --success-text: #166534;
    --radius: 6px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.08);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --transition: 150ms ease;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

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

/* --- Layout Utilities --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.hidden {
    display: none !important;
}

/* --- Animations --- */
.fade-in {
    animation: fadeIn 200ms ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.slide-in {
    animation: slideIn 200ms ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- Navigation --- */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    height: 56px;
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.nav-brand {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-brand:hover {
    color: var(--accent);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--secondary);
    text-decoration: none;
    padding: 4px 0;
    transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}

.mobile-menu {
    display: none;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
}

.mobile-menu ul {
    list-style: none;
}

.mobile-menu a {
    display: block;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--secondary);
}

.mobile-menu a:hover {
    color: var(--primary);
}

/* --- Page Header (replaces hero) --- */
.page-header {
    padding: 40px 0 32px;
    margin-top: 56px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.page-header p {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 540px;
}

/* --- Decision Card --- */
.decision-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.decision-card-body {
    padding: 32px;
}

/* --- Question Card --- */
.question-card {
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.question-card h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--primary);
    line-height: 1.5;
}

/* --- Buttons --- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary);
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
    text-decoration: none;
    font-family: var(--font);
}

.btn-primary:hover {
    background: #334155;
}

.btn-primary:active {
    background: #0f172a;
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.answer-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--surface);
    color: var(--secondary);
    padding: 10px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
    font-family: var(--font);
}

.btn-secondary:hover {
    background: var(--hover-bg);
    border-color: var(--border-strong);
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--radius);
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
    font-family: var(--font);
}

.btn-action:hover {
    background: #115e59;
}

/* --- Answer Buttons --- */
.answer-btn {
    width: 100%;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-family: var(--font);
}

.answer-btn:hover {
    border-color: var(--accent);
    background: var(--hover-bg);
}

.answer-btn:active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* --- Result Card --- */
.result-card {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
}

.result-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--success-text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-body {
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
}

.result-body h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.result-body p {
    margin-bottom: 6px;
}

.result-label {
    font-weight: 600;
    color: var(--secondary);
    font-size: 13px;
}

.result-note {
    color: #92400e;
    font-size: 13px;
}

.result-legal {
    color: var(--accent);
    font-size: 13px;
}

/* --- History --- */
.history-container {
    padding: 16px;
    background: var(--hover-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 8px;
}

.history-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
}

.history-list {
    list-style: none;
}

.history-list li {
    font-size: 13px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.history-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.history-question {
    font-weight: 500;
    color: var(--primary);
}

.history-answer {
    color: var(--text-muted);
    margin-left: 12px;
    display: block;
    margin-top: 2px;
}

/* --- Decision Path --- */
.decision-path {
    position: relative;
    padding: 12px 16px;
    background: var(--hover-bg);
    border-radius: var(--radius);
    margin-bottom: 6px;
    border-left: 3px solid var(--accent);
}

/* --- Initial Screen --- */
.initial-screen {
    text-align: center;
    padding: 48px 24px;
}

.initial-screen h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.initial-screen p {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 24px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Legal / Disclaimer --- */
.legal-text {
    font-size: 13px;
    line-height: 1.6;
    background: var(--hover-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 16px 20px;
    margin-top: 32px;
}

.legal-text h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.legal-text p {
    color: var(--text-muted);
}

.legal-icon {
    color: var(--text-muted);
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.legal-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

/* --- Contact Section --- */
.contact-section {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--hover-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.contact-section p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.contact-section a {
    font-size: 13px;
    color: var(--accent);
}

.contact-section a:hover {
    color: var(--primary);
}

/* --- Action Buttons Row --- */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

/* --- Loading --- */
.loading-container {
    text-align: center;
    padding: 32px 0;
}

.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-bottom: 8px;
}

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

.loading-text {
    font-size: 14px;
    color: var(--text-muted);
}

/* --- Footer --- */
.site-footer {
    background: var(--primary);
    color: #e2e8f0;
    padding: 40px 0 24px;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 24px;
}

.site-footer h4 {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
}

.site-footer p,
.site-footer a,
.site-footer li {
    font-size: 13px;
    color: #94a3b8;
}

.site-footer a:hover {
    color: #e2e8f0;
}

.site-footer ul {
    list-style: none;
}

.site-footer ul li {
    margin-bottom: 6px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
    text-align: center;
}

.footer-bottom p {
    font-size: 12px;
    color: #64748b;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.footer-brand img {
    height: 28px;
    filter: brightness(0) invert(1);
}

/* --- Cookie Banner --- */
#cookie-banner {
    background: var(--primary);
    color: #e2e8f0;
    padding: 16px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 100;
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    max-width: 440px;
    margin: 0 auto;
    font-size: 13px;
}

/* --- Main Content Area --- */
.main-content {
    padding: 32px 0 48px;
}

/* --- Blog --- */
.blog-article {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.blog-article:last-child {
    border-bottom: none;
}

.blog-article h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.blog-article h3 a {
    color: var(--primary);
}

.blog-article h3 a:hover {
    color: var(--accent);
}

.blog-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.blog-excerpt {
    font-size: 14px;
    color: var(--secondary);
    line-height: 1.6;
    margin-bottom: 8px;
}

.blog-read-more {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
}

.blog-read-more:hover {
    color: var(--primary);
}

/* --- PDF Export --- */
#export-pdf-button {
    z-index: 10;
    position: relative;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: block;
    }

    .mobile-menu.is-open {
        display: block;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .initial-screen {
        padding: 32px 16px;
    }

    .decision-card-body {
        padding: 20px;
    }

    .btn-primary {
        width: 100%;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn-action,
    .action-buttons .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}