/* ============================================================
   ElternArchiv – Designsystem auf Basis des Optimello CI-Folios v2.1
   Farben, Typografie und Kontrastregeln 1:1 aus dem Brand-Guide übernommen.
   ============================================================ */

:root {
    --color-petrol: #2F6B6B;       /* Logo-Bezug, Icons, Links (nur Großtext) */
    --color-petrol-dark: #1B3C3C;  /* Headlines, Footer, dunkle Flächen (AAA-Kontrast) */
    --color-bordeaux: #8A3B42;     /* Ausschließlich Buttons/CTAs/Akzente */
    --color-offwhite: #F4F1EA;     /* Standard-Seitenhintergrund */
    --color-ink: #1A1A18;          /* Fließtext (Fast-Schwarz) */
    --color-white: #FFFDF9;

    --font-display: "Poppins", "Montserrat", sans-serif;
    --font-body: "Work Sans", "Calibri", "Arial", sans-serif;

    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 999px;

    --shadow-soft: 0 8px 30px rgba(27, 60, 60, 0.10);
    --shadow-lift: 0 16px 40px rgba(27, 60, 60, 0.16);

    --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--color-offwhite);
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: var(--font-display);
    color: var(--color-petrol-dark);
    line-height: 1.2;
    margin: 0 0 0.5em;
}

h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 700; }
h2 { font-size: clamp(24px, 3.5vw, 28px); font-weight: 700; }
h3 { font-size: clamp(18px, 2.5vw, 20px); font-family: var(--font-body); font-weight: 700; }

p { margin: 0 0 1em; }

a {
    color: var(--color-petrol-dark);
    text-decoration-color: rgba(27, 60, 60, 0.35);
}

a:hover { text-decoration-color: currentColor; }

.container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

.caption {
    font-size: 14px;
    color: rgba(26, 26, 24, 0.65);
}

.subtitle {
    font-family: var(--font-display);
    font-weight: 500;
    color: var(--color-bordeaux);
    font-size: clamp(16px, 2vw, 18px);
}

/* ---- Buttons ------------------------------------------------------ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.25s var(--ease-smooth), box-shadow 0.25s var(--ease-smooth), background 0.2s ease;
}

.btn-primary {
    background: var(--color-bordeaux);
    color: var(--color-white);
    box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lift);
    background: #7a333a;
}

.btn-secondary {
    background: transparent;
    color: var(--color-petrol-dark);
    border: 1.5px solid rgba(27, 60, 60, 0.35);
}

.btn-secondary:hover {
    border-color: var(--color-petrol-dark);
    background: rgba(27, 60, 60, 0.06);
}

.btn-block { width: 100%; }

/* ---- Header --------------------------------------------------------- */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand img {
    width: 44px;
    height: 44px;
    display: block;
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color-petrol-dark);
    font-size: 18px;
    letter-spacing: 0.02em;
}

/* ---- Hero ------------------------------------------------------------ */

.hero {
    position: relative;
    padding: 64px 0 80px;
    overflow: hidden;
    background:
        radial-gradient(circle at 15% 20%, rgba(47, 107, 107, 0.12), transparent 55%),
        radial-gradient(circle at 85% 0%, rgba(138, 59, 66, 0.08), transparent 45%);
}

.hero-inner {
    max-width: 720px;
}

.hero .eyebrow {
    display: inline-block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-petrol);
    background: rgba(47, 107, 107, 0.10);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    margin-bottom: 20px;
}

.hero h1 span {
    color: var(--color-bordeaux);
}

.hero .lead {
    font-size: 19px;
    color: rgba(26, 26, 24, 0.8);
    max-width: 540px;
}

.hero .cta-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 32px;
}

/* Fade/slide-up entrance choreography, gestaffelt per style="--delay" */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    animation: reveal-in 0.7s var(--ease-smooth) forwards;
    animation-delay: var(--delay, 0s);
}

@keyframes reveal-in {
    to { opacity: 1; transform: translateY(0); }
}

/* Scroll-getriggerte Sections: JS setzt .is-visible, siehe app.js */
.scroll-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease-smooth), transform 0.7s var(--ease-smooth);
}

.scroll-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- How it works ------------------------------------------------------ */

.section {
    padding: 64px 0;
}

.section-heading {
    text-align: center;
    max-width: 620px;
    margin: 0 auto 48px;
}

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

@media (max-width: 760px) {
    .steps { grid-template-columns: 1fr; }
}

.step {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    box-shadow: var(--shadow-soft);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--color-petrol-dark);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    margin-bottom: 18px;
}

/* ---- Coffee explainer box ------------------------------------------------- */

.coffee-explainer {
    background: var(--color-petrol-dark);
    color: var(--color-offwhite);
    border-radius: var(--radius-lg);
    padding: 44px;
    box-shadow: var(--shadow-lift);
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: center;
    justify-content: space-between;
}

.coffee-explainer h2 { color: var(--color-white); }
.coffee-explainer p { color: rgba(244, 241, 234, 0.88); }

.coffee-explainer .content { flex: 1 1 420px; }

/* ---- Trust section ------------------------------------------------------- */

.trust-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-white);
    border: 1px solid rgba(27, 60, 60, 0.12);
    border-radius: var(--radius-full);
    padding: 10px 18px;
    font-size: 14px;
    color: var(--color-petrol-dark);
    font-weight: 600;
}

.trust-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-petrol);
    flex: none;
}

/* ---- Footer --------------------------------------------------------------- */

.site-footer {
    background: var(--color-petrol-dark);
    color: rgba(244, 241, 234, 0.82);
    padding: 48px 0 32px;
    margin-top: 64px;
}

.site-footer a { color: var(--color-offwhite); }

.site-footer .footer-top {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 24px;
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
}

.footer-fine {
    font-size: 13px;
    color: rgba(244, 241, 234, 0.55);
    border-top: 1px solid rgba(244, 241, 234, 0.15);
    padding-top: 20px;
}

/* ---- Sticky Kaffeekassen-Button -------------------------------------------- */

.coffee-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 60;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 22px;
    border-radius: var(--radius-full);
    background: var(--color-bordeaux);
    color: var(--color-white);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(138, 59, 66, 0.35);
    animation: coffee-breathe 4s ease-in-out infinite;
    transition: box-shadow 0.3s ease, transform 0.3s var(--ease-smooth);
}

.coffee-btn:hover {
    box-shadow: 0 0 0 8px rgba(138, 59, 66, 0.18), 0 14px 34px rgba(138, 59, 66, 0.4);
    transform: translateY(-2px);
}

.coffee-btn .icon { font-size: 18px; }

@keyframes coffee-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.035); }
}

@media (prefers-reduced-motion: reduce) {
    .coffee-btn { animation: none; }
    .reveal, .scroll-reveal { animation: none !important; opacity: 1; transform: none; transition: none; }
}

@media (max-width: 480px) {
    .coffee-btn span.label { display: none; }
    .coffee-btn { padding: 16px; }
}

/* ---- Code-Gate -------------------------------------------------------------- */

.gate-wrap {
    min-height: calc(100vh - 90px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.gate-card {
    width: 100%;
    max-width: 420px;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow: var(--shadow-lift);
    text-align: center;
    transition: opacity 0.4s var(--ease-smooth), transform 0.4s var(--ease-smooth);
}

.gate-card.is-leaving {
    opacity: 0;
    transform: translateY(-12px);
}

.gate-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    display: block;
}

.gate-input {
    width: 100%;
    font-family: var(--font-display);
    font-size: 22px;
    letter-spacing: 0.06em;
    text-align: center;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 2px solid rgba(27, 60, 60, 0.18);
    background: var(--color-offwhite);
    color: var(--color-petrol-dark);
    margin: 20px 0;
    transition: border-color 0.2s ease;
}

.gate-input:focus {
    outline: none;
    border-color: var(--color-petrol);
}

.gate-card.has-error .gate-input {
    border-color: var(--color-bordeaux);
    animation: shake 0.45s ease;
}

.gate-error {
    color: var(--color-bordeaux);
    font-size: 14px;
    font-weight: 600;
    min-height: 20px;
    margin-bottom: 4px;
}

@keyframes shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-8px); }
    40%, 60% { transform: translateX(8px); }
}

/* ---- Video-Galerie ------------------------------------------------------------ */

.gallery-header {
    padding: 40px 0 8px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    padding: 32px 0 80px;
}

.video-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    border: none;
    text-align: left;
    padding: 0;
    font: inherit;
    color: inherit;
    opacity: 0;
    transform: translateY(16px);
    animation: reveal-in 0.6s var(--ease-smooth) forwards;
    animation-delay: var(--delay, 0s);
    transition: transform 0.25s var(--ease-smooth), box-shadow 0.25s var(--ease-smooth);
}

.video-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lift);
}

.video-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--color-petrol-dark) center / cover no-repeat;
    position: relative;
}

.video-thumb .play-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-thumb .play-badge span {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(244, 241, 234, 0.92);
    color: var(--color-petrol-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.video-card .meta {
    padding: 16px 18px 20px;
}

.video-card .meta h3 {
    margin: 0 0 6px;
}

.video-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: rgba(47, 107, 107, 0.12);
    color: var(--color-petrol-dark);
}

/* ---- Player-Sheet (Modal / Slide-up) ------------------------------------------- */

.player-overlay {
    position: fixed;
    inset: 0;
    background: rgba(27, 60, 60, 0.55);
    backdrop-filter: blur(6px);
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s var(--ease-smooth);
}

.player-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.player-sheet {
    background: var(--color-ink);
    width: 100%;
    max-width: 900px;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.4s var(--ease-smooth);
}

.player-overlay.is-open .player-sheet {
    transform: translateY(0);
}

@media (min-width: 760px) {
    .player-overlay { align-items: center; }
    .player-sheet {
        border-radius: 20px;
        transform: translateY(24px) scale(0.98);
    }
    .player-overlay.is-open .player-sheet {
        transform: translateY(0) scale(1);
    }
}

.player-sheet video,
.player-sheet iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    background: #000;
    border: none;
}

.player-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px 22px;
    background: var(--color-petrol-dark);
    color: var(--color-offwhite);
}

.player-footer .no-download-note {
    font-size: 13px;
    color: rgba(244, 241, 234, 0.75);
}

.player-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: none;
    font-size: 18px;
    cursor: pointer;
    z-index: 5;
}

/* ---- Formulare (öffentlich + Admin) ------------------------------------------- */

.form-field { margin-bottom: 18px; text-align: left; }

.form-field label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--color-petrol-dark);
    margin-bottom: 6px;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"],
.form-field input[type="number"],
.form-field input[type="date"],
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1.5px solid rgba(27, 60, 60, 0.2);
    background: var(--color-offwhite);
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--color-ink);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--color-petrol);
}

.form-hint { font-size: 13px; color: rgba(26,26,24,0.6); margin-top: 4px; }

.alert {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 20px;
}

.alert-error { background: rgba(138, 59, 66, 0.1); color: var(--color-bordeaux); }
.alert-success { background: rgba(47, 107, 107, 0.12); color: var(--color-petrol-dark); }

/* ---- Admin-Layout (schlicht & funktional) ------------------------------------- */

.admin-shell { min-height: 100vh; }

.admin-topbar {
    background: var(--color-petrol-dark);
    color: var(--color-offwhite);
    padding: 16px 0;
}

.admin-topbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-topbar a { color: var(--color-offwhite); text-decoration: none; font-weight: 600; }

.admin-main { padding: 36px 0 80px; }

.admin-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 24px;
}

table.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table.admin-table th {
    text-align: left;
    background: var(--color-petrol-dark);
    color: var(--color-white);
    padding: 10px 14px;
}

table.admin-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(27, 60, 60, 0.1);
}

.tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.tag-active { background: rgba(47,107,107,0.15); color: var(--color-petrol-dark); }
.tag-revoked { background: rgba(138,59,66,0.15); color: var(--color-bordeaux); }

.upload-progress {
    width: 100%;
    height: 10px;
    border-radius: var(--radius-full);
    background: rgba(27, 60, 60, 0.12);
    overflow: hidden;
    margin-top: 10px;
}

.upload-progress .bar {
    height: 100%;
    width: 0%;
    background: var(--color-petrol);
    transition: width 0.2s ease;
}

.upload-queue-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px 140px;
    align-items: center;
    gap: 14px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(27, 60, 60, 0.08);
}

.upload-queue-row .upload-queue-name {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-queue-row .upload-progress {
    margin: 0;
}

.upload-queue-row .upload-queue-status {
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .upload-queue-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .upload-queue-row .upload-queue-status { text-align: left; }
}
