/* =============================================================================
   APRES-SQI 2026 — Openbare homepage (retro winters Apres-sQi)
   ============================================================================= */
:root {
    --apres-cream: #f4f1ea;
    --apres-cream-dark: #e8e4da;
    --apres-navy: #0f2347;
    --apres-navy-deep: #0a1830;
    --apres-red: #c41e3a;
    --apres-red-dark: #9e1830;
    --apres-wood: #8b5a2b;
    --apres-wood-light: #c67b3c;
    --apres-orange: #e85d24;
    --apres-snow: rgba(255, 255, 255, 0.9);

    --font-display: 'Bebas Neue', Impact, sans-serif;
    --font-condensed: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    --font-body: 'DM Sans', system-ui, sans-serif;

    /* Bewonersportaal (donker, huisstijl) */
    --color-red: #e30613;
    --color-red-hover: #c00510;
    --color-red-soft: rgba(227, 6, 19, 0.18);
    --color-blue: #003399;
    --color-blue-hover: #002266;
    --color-blue-soft: rgba(0, 51, 153, 0.2);
    --color-gold: #ffd700;
    --color-bg: #0a0e1a;
    --color-surface: #121a2e;
    --color-surface-elevated: #1a2540;
    --color-border: #2a3a5c;
    --color-text: #f0f4fa;
    --color-text-muted: #9aa8c4;
    --color-success: #22c55e;
    --color-success-soft: rgba(34, 197, 94, 0.15);
    --color-error: #ef4444;
    --color-error-soft: rgba(239, 68, 68, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35);
    --transition: 0.2s ease;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
}

/* ----- Apres-sQi pagina ----- */
.apres-page {
    position: relative;
    min-height: 100vh;
    background: var(--apres-cream);
    color: var(--apres-navy);
    overflow-x: hidden;
}

.apres-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 60% at 50% -10%, rgba(196, 30, 58, 0.08), transparent 50%),
        radial-gradient(ellipse 70% 50% at 100% 50%, rgba(15, 35, 71, 0.06), transparent 45%),
        linear-gradient(180deg, var(--apres-cream) 0%, var(--apres-cream-dark) 100%);
    pointer-events: none;
    z-index: 0;
}

.apres-snow {
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(2px 2px at 20px 30px, var(--apres-snow), transparent),
        radial-gradient(2px 2px at 80px 120px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1.5px 1.5px at 150px 80px, var(--apres-snow), transparent),
        radial-gradient(2px 2px at 250px 200px, rgba(255,255,255,0.5), transparent);
    background-size: 300px 300px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

.apres-page > *:not(.apres-snow) {
    position: relative;
    z-index: 1;
}

/* Header */
.apres-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

.apres-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--apres-navy);
    font-family: var(--font-condensed);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.apres-brand-icon {
    object-fit: contain;
}

.nav-login-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.1rem;
    font-family: var(--font-condensed);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--apres-cream);
    background: var(--apres-navy);
    border: 2px solid var(--apres-navy);
    border-radius: 4px;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), transform var(--transition);
    box-shadow: 0 2px 0 var(--apres-navy-deep);
}

.nav-login-btn:hover {
    background: var(--apres-red);
    border-color: var(--apres-red);
    transform: translateY(-1px);
    box-shadow: 0 3px 0 var(--apres-red-dark);
}

/* Hero layout */
.apres-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
}

.apres-hero {
    display: grid;
    gap: 2rem;
    grid-template-columns: auto 1fr;
    align-items: stretch;
}

@media (max-width: 900px) {
    .apres-hero {
        grid-template-columns: 1fr;
        justify-items: center;
        align-items: start;
    }
}

.apres-hero-poster {
    width: fit-content;
    max-width: 100%;
    display: flex;
}

.apres-hero-poster .chalet-card--poster {
    height: 100%;
}

.apres-hero-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 100%;
}

.apres-hero-header {
    flex-shrink: 0;
}

.apres-hero-header .apres-title {
    margin-bottom: 0.75rem;
}

.apres-tagline {
    margin: 0 0 0.25rem;
    font-family: var(--font-condensed);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--apres-wood);
}

.apres-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 12vw, 6.5rem);
    font-weight: 400;
    line-height: 0.95;
    letter-spacing: 0.02em;
    color: var(--apres-red);
    text-shadow:
        3px 3px 0 var(--apres-navy),
        -1px -1px 0 var(--apres-navy-deep);
}

/* Berghut / chalet cards */
.chalet-card {
    position: relative;
    background: linear-gradient(165deg, #f9f6f0 0%, #ebe6dc 100%);
    border: 3px solid var(--apres-wood);
    border-radius: 4px 4px 12px 12px;
    box-shadow:
        0 6px 0 var(--apres-wood-light),
        0 12px 32px rgba(15, 35, 71, 0.15);
    overflow: hidden;
}

.chalet-roof {
    height: 14px;
    background: repeating-linear-gradient(
        -45deg,
        var(--apres-red),
        var(--apres-red) 8px,
        var(--apres-navy) 8px,
        var(--apres-navy) 16px
    );
    border-bottom: 2px solid var(--apres-wood);
}

.chalet-card--poster {
    padding: 0;
    width: fit-content;
    max-width: 100%;
}

.poster-wrap {
    position: relative;
    width: fit-content;
    max-width: 100%;
    line-height: 0;
    overflow: hidden;
    background: var(--apres-navy-deep);
}

.apres-poster-embed {
    display: block;
    width: 360px;
    max-width: 100%;
    height: 509px;
    max-height: min(70vh, 509px);
    border: none;
    vertical-align: top;
    object-fit: contain;
}

@media (max-width: 400px) {
    .apres-poster-embed {
        width: 100%;
        height: auto;
        aspect-ratio: 360 / 509;
        max-height: none;
    }
}

.poster-fullscreen-link {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    padding: 0.4rem 0.75rem;
    font-family: var(--font-condensed);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--apres-cream);
    background: var(--apres-navy);
    text-decoration: none;
    border-radius: 3px;
    opacity: 0.92;
    transition: background var(--transition);
}

.poster-fullscreen-link:hover {
    background: var(--apres-red);
}

/* Info cards — 3 rijen × 2 kolommen, hoogte = poster minus header */
.info-chalet-grid {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(3, 1fr);
    grid-template-areas:
        "datum datum"
        "programma fotos"
        "locatie social";
    gap: 0.75rem;
    width: 100%;
    min-height: 0;
}

.info-card--datum { grid-area: datum; }
.info-card--programma { grid-area: programma; }
.info-card--fotos { grid-area: fotos; }
.info-card--locatie { grid-area: locatie; }
.info-card--social { grid-area: social; }

.info-chalet-grid > .info-card-link {
    height: 100%;
    min-height: 0;
    min-width: 0;
}

.info-card-link {
    display: flex;
    flex-direction: column;
    width: 100%;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.info-card-link:visited,
.info-card-link:hover,
.info-card-link:focus,
.info-card-link:active {
    text-decoration: none;
    color: inherit;
}

.info-card-link:hover {
    transform: scale(1.03);
    box-shadow:
        0 8px 0 var(--apres-wood-light),
        0 16px 40px rgba(15, 35, 71, 0.22);
    z-index: 1;
}

.info-card-link:focus-visible {
    outline: 3px solid var(--apres-navy);
    outline-offset: 3px;
}

.info-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.85rem 1rem 1rem;
    width: 100%;
    min-height: 0;
}

.info-card--fotos,
.info-card--locatie,
.info-card--social {
    padding: 0.75rem 0.85rem 0.9rem;
}

.info-card--fotos .info-value,
.info-card--locatie .info-value {
    font-size: 1.15rem;
}

.info-card--social .instagram-handle {
    font-size: 1.35rem;
}

.info-card--highlight {
    background: linear-gradient(165deg, #fff8f0 0%, #fde8d8 100%);
    border-color: var(--apres-orange);
    box-shadow:
        0 6px 0 var(--apres-wood-light),
        0 0 0 2px var(--apres-red);
}

.info-card-link.info-card--highlight:hover {
    box-shadow:
        0 8px 0 var(--apres-wood-light),
        0 0 0 2px var(--apres-red),
        0 16px 40px rgba(196, 30, 58, 0.2);
}

.info-card--highlight .chalet-roof {
    background: linear-gradient(90deg, var(--apres-red), var(--apres-orange), var(--apres-red));
}

.info-card--social .instagram-handle {
    font-family: var(--font-display);
    font-size: 1.75rem;
    letter-spacing: 0.02em;
    color: var(--apres-red);
}

.info-card-link.info-card--social:hover .instagram-handle {
    color: var(--apres-navy);
}

@media (max-width: 900px) {
    .apres-hero-content {
        height: auto;
    }

    .info-chalet-grid {
        flex: none;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        grid-template-areas:
            "datum"
            "programma"
            "fotos"
            "locatie"
            "social";
    }

    .info-chalet-grid > .info-card-link {
        height: auto;
    }
}

.info-label {
    margin: 0 0 0.35rem;
    font-family: var(--font-condensed);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--apres-wood);
}

.info-value {
    margin: 0;
    font-family: var(--font-condensed);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--apres-navy);
}

.info-card--highlight .info-value {
    font-size: 1.5rem;
    color: var(--apres-red);
}

.info-sep {
    color: var(--apres-wood-light);
    font-weight: 400;
}

/* ----- Info-subpagina's & fotoarchief ----- */
.info-page {
    min-height: 100vh;
    background: var(--apres-cream);
    color: var(--apres-navy);
    padding: 1.5rem 1rem 3rem;
}

.info-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 60% at 50% -10%, rgba(196, 30, 58, 0.08), transparent 50%),
        linear-gradient(180deg, var(--apres-cream) 0%, var(--apres-cream-dark) 100%);
    pointer-events: none;
    z-index: 0;
}

.info-container {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
    background: #fff;
    padding: 2rem 2.25rem 2.5rem;
    border-radius: var(--radius-md);
    border: 3px solid var(--apres-wood);
    box-shadow:
        0 6px 0 var(--apres-wood-light),
        0 12px 40px rgba(15, 35, 71, 0.12);
}

.info-container--breed {
    max-width: 820px;
}

.info-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    border-radius: 9px 9px 0 0;
    background: linear-gradient(
        90deg,
        var(--apres-navy) 33%,
        var(--apres-red) 33%,
        var(--apres-red) 66%,
        var(--apres-orange) 66%
    );
}

.terug-knop {
    display: inline-block;
    margin-bottom: 1.25rem;
    font-family: var(--font-condensed);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--apres-navy);
    text-decoration: none;
    transition: color var(--transition), transform var(--transition);
}

.terug-knop:hover {
    color: var(--apres-red);
    transform: translateX(-4px);
}

.info-titel {
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-size: clamp(2rem, 6vw, 2.75rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--apres-red);
    text-shadow:
        2px 2px 0 var(--apres-navy),
        -1px -1px 0 var(--apres-navy-deep);
}

.info-intro {
    margin: 0 0 2rem;
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--apres-wood);
    line-height: 1.6;
}

.info-sectie-titel {
    margin: 0 0 1rem;
    font-family: var(--font-condensed);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--apres-wood);
    border-bottom: 2px dashed var(--apres-cream-dark);
    padding-bottom: 0.5rem;
}

/* Fotoarchief — jaar-knoppen (chalet-stijl) */
.jaar-knoppen-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.jaar-knop {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    margin: 0;
    padding: 0.85rem 1rem 1rem;
    font: inherit;
    text-align: left;
    color: inherit;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.jaar-knop:hover {
    transform: scale(1.03);
    box-shadow:
        0 8px 0 var(--apres-wood-light),
        0 16px 40px rgba(15, 35, 71, 0.22);
    z-index: 1;
}

.jaar-knop:focus-visible {
    outline: 3px solid var(--apres-navy);
    outline-offset: 3px;
}

.jaar-knop--huidig {
    background: linear-gradient(165deg, #fff8f0 0%, #fde8d8 100%);
    border-color: var(--apres-orange);
    box-shadow:
        0 6px 0 var(--apres-wood-light),
        0 0 0 2px var(--apres-red);
}

.jaar-knop--huidig:hover {
    box-shadow:
        0 8px 0 var(--apres-wood-light),
        0 0 0 2px var(--apres-red),
        0 16px 40px rgba(196, 30, 58, 0.2);
}

.jaar-knop--huidig .chalet-roof {
    background: linear-gradient(90deg, var(--apres-red), var(--apres-orange), var(--apres-red));
}

.jaar-knop .info-value {
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: 0.04em;
}

/* Fotoarchief — placeholder-grids per jaar */
.fotos-jaar-sectie {
    margin-bottom: 2.5rem;
    scroll-margin-top: 1.5rem;
}

.fotos-jaar-sectie:last-of-type {
    margin-bottom: 0;
}

.fotos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    min-height: 5rem;
    padding: 1rem;
    background: repeating-linear-gradient(
        -3deg,
        var(--apres-cream) 0,
        var(--apres-cream) 8px,
        #fff 8px,
        #fff 16px
    );
    border: 2px dashed var(--apres-cream-dark);
    border-radius: 4px;
}

.fotos-grid:empty::after {
    content: 'Foto\'s worden hier geladen…';
    grid-column: 1 / -1;
    display: block;
    padding: 0.5rem 0;
    font-family: var(--font-condensed);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    color: var(--apres-wood);
    opacity: 0.85;
}

@media (max-width: 520px) {
    .info-container {
        padding: 1.5rem 1.25rem 2rem;
    }

    .jaar-knoppen-grid {
        grid-template-columns: 1fr;
    }

    .jaar-knop .info-value {
        font-size: 1.75rem;
    }
}

/* Login modal (checkbox — blijft compatibel met app.js hidden) */
.login-modal-toggle {
    position: fixed;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

#login-sectie.login-modal {
    display: none !important;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    margin: 0;
    background: transparent;
    border: none;
}

#login-modal-toggle:checked ~ #login-sectie.login-modal {
    display: flex !important;
}

.login-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 35, 71, 0.55);
    cursor: pointer;
}

.login-modal-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    padding: 1.75rem 1.5rem 1.5rem;
    margin: 0;
}

.login-modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--apres-navy);
    background: var(--apres-cream);
    border: 2px solid var(--apres-wood);
    border-radius: 4px;
    cursor: pointer;
}

.login-modal-close:hover {
    background: var(--apres-red);
    color: white;
    border-color: var(--apres-red);
}

.login-modal-title {
    margin: 0.5rem 0 0.25rem;
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--apres-navy);
    letter-spacing: 0.03em;
}

.login-modal-sub {
    margin: 0 0 1.25rem;
    font-size: 0.9rem;
    color: var(--apres-wood);
}

.apres-page .form label {
    display: block;
    font-family: var(--font-condensed);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--apres-wood);
    margin-bottom: 0.35rem;
}

.apres-page .form input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    margin-bottom: 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--apres-navy);
    background: white;
    border: 2px solid var(--apres-cream-dark);
    border-radius: 4px;
}

.apres-page .form input:focus {
    outline: none;
    border-color: var(--apres-navy);
    box-shadow: 0 0 0 3px rgba(15, 35, 71, 0.15);
}

.apres-page .btn-primary {
    background: var(--apres-red);
    color: white;
    border: none;
    border-radius: 4px;
    font-family: var(--font-condensed);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    box-shadow: 0 3px 0 var(--apres-red-dark);
    transition: transform var(--transition), background var(--transition);
}

.apres-page .btn-primary:hover:not(:disabled) {
    background: var(--apres-navy);
    box-shadow: 0 3px 0 var(--apres-navy-deep);
}

.apres-page .btn-block {
    width: 100%;
}

.apres-page .btn-loader {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.apres-page .alert-error {
    padding: 0.75rem;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--apres-red-dark);
    background: rgba(196, 30, 58, 0.1);
    border: 1px solid var(--apres-red);
    border-radius: 4px;
}

.apres-page .alert[hidden] {
    display: none;
}

/* Footer */
.apres-footer {
    text-align: center;
    padding: 2rem 1.5rem 2.5rem;
    font-family: var(--font-condensed);
    color: var(--apres-wood);
}

.apres-footer a {
    color: var(--apres-red);
    font-weight: 700;
    text-decoration: none;
}

.apres-footer a:hover {
    text-decoration: underline;
}

.apres-footer-small {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    opacity: 0.85;
}

/* =============================================================================
   BEWONERSPORTAAL — Questo 1987 (ingelogd)
   ============================================================================= */
.view[hidden] {
    display: none !important;
}

#portal-view {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
}

#portal-view::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 45% at 0% 0%, var(--color-red-soft), transparent 55%),
        radial-gradient(ellipse 60% 50% at 100% 0%, var(--color-blue-soft), transparent 55%);
    pointer-events: none;
    z-index: -1;
}

#portal-view h1, #portal-view h2, #portal-view h3 {
    font-family: var(--font-body);
    font-weight: 600;
}

.text-muted {
    color: var(--color-text-muted);
    margin: 0 0 1rem;
    font-size: 0.95rem;
}

.portal-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1.25rem;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--color-red), var(--color-blue)) 1;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.portal-brand h1 {
    font-size: 1.5rem;
    margin: 0;
    background: linear-gradient(135deg, var(--color-red), #fff 40%, var(--color-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.year-accent {
    background: linear-gradient(90deg, var(--color-gold), #fff9c4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.portal-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: white;
    background: linear-gradient(90deg, var(--color-red), var(--color-blue));
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
}

.portal-crest, .portal-q {
    object-fit: contain;
}

.portal-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-email {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.house-colors-bar {
    width: 100%;
    height: 4px;
    margin: 0 0 1.25rem;
    background: linear-gradient(90deg, var(--color-red) 50%, var(--color-blue) 50%);
}

.tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.35rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.tab-btn {
    flex: 1;
    min-width: 140px;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.tab-btn:hover {
    color: var(--color-text);
    background: var(--color-blue-soft);
}

.tab-btn.active {
    color: white;
    background: linear-gradient(135deg, var(--color-red), var(--color-blue));
}

.tab-panel {
    display: none;
    animation: fadeIn 0.25s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.panel-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--color-red), var(--color-blue)) 1;
}

.panel-icon {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.panel-icon--crest {
    width: 48px;
    height: 48px;
}

.card {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-red), var(--color-blue));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.item-card {
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-blue);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: border-color var(--transition), transform var(--transition);
}

.item-card:hover {
    border-left-color: var(--color-red);
    transform: translateY(-2px);
}

.item-card h3 {
    font-size: 1rem;
    margin: 0 0 0.35rem;
}

.item-card p {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.item-card .meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

#portal-view .form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--color-text-muted);
}

#portal-view .form input,
#portal-view .form textarea,
.chwazi-config textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

#portal-view .form input:focus,
#portal-view .form textarea:focus,
.chwazi-config textarea:focus {
    outline: none;
    border-color: var(--color-blue);
    box-shadow: 0 0 0 3px var(--color-blue-soft);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-red), var(--color-red-hover));
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--color-surface-elevated);
    color: var(--color-text);
    border: 2px solid var(--color-blue);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--color-blue-soft);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.btn-ghost:hover {
    color: var(--color-text);
    border-color: var(--color-red);
}

.btn-block { width: 100%; }
.btn-lg { padding: 0.9rem 1.5rem; font-size: 1.05rem; }

.btn-loader {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

.alert[hidden] { display: none; }

.alert-error {
    background: var(--color-error-soft);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-success {
    background: var(--color-success-soft);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.loading-state,
.empty-state {
    text-align: center;
    padding: 2.5rem;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
}

.empty-state[hidden],
.loading-state[hidden] {
    display: none;
}

.recepten-layout {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr 320px;
}

@media (max-width: 900px) {
    .recepten-layout {
        grid-template-columns: 1fr;
    }
}

.form-card {
    position: sticky;
    top: 1rem;
    height: fit-content;
}

.recept-card {
    cursor: pointer;
}

.recept-card .preview {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.modal {
    border: none;
    padding: 0;
    background: transparent;
    max-width: 90vw;
    width: 520px;
}

.modal::backdrop {
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-red), var(--color-blue));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    font-size: 1.5rem;
    color: var(--color-text-muted);
    background: none;
    border: none;
    cursor: pointer;
}

.recept-detail-block h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-blue);
}

.recept-detail-block pre {
    white-space: pre-wrap;
    font-family: inherit;
    color: var(--color-text-muted);
}

.chwazi-layout {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 768px) {
    .chwazi-layout {
        grid-template-columns: 1fr;
    }
}

.chwazi-taak-select {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.radio-label input {
    accent-color: var(--color-red);
}

.chwazi-display {
    position: relative;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    padding: 2rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--color-red-soft), var(--color-blue-soft));
    border-radius: var(--radius-md);
    overflow: hidden;
}

.chwazi-bg-logo {
    position: absolute;
    width: 120px;
    opacity: 0.08;
}

.chwazi-display .winner {
    color: var(--color-red);
    font-size: 2rem;
    position: relative;
    z-index: 1;
}

.chwazi-placeholder {
    color: var(--color-text-muted);
    font-size: 1rem;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

.chwazi-display.spinning {
    animation: chwaziPulse 0.15s ease infinite;
}

@keyframes chwaziPulse {
    50% { transform: scale(1.02); }
}

.chwazi-resultaat {
    text-align: center;
    color: var(--color-text-muted);
}

.chwazi-resultaat strong {
    color: var(--color-blue);
}

.chwazi-resultaat[hidden] {
    display: none;
}

.doc-link {
    color: var(--color-blue);
    font-weight: 600;
    text-decoration: none;
}

.doc-link:hover {
    color: var(--color-red);
    text-decoration: underline;
}
