/* NutriCampus – Basis-Styles (Design aus legacy/nutricampus-register übernommen).
   Farben kommen als CSS-Variablen aus den Einstellungen (layouts/app.blade.php). */

:root {
    --accent: #4CAF50;
    --accent-dark: #3d8b40;
    --navy: #2c3e6b;
    --text: #1a2332;
    --muted: #6c757d;
    --border: #e1e7e3;
    --bg: #f5f7fa;
    --danger: #c0392b;
    --radius: 16px;
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
}

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

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

a { color: var(--navy); }

/* Kopfzeile */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.site-header__inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.site-logo {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--navy);
    text-decoration: none;
}
.site-logo img { max-height: 44px; display: block; }
.site-nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.site-nav a { text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.site-nav form { margin: 0; }

.site-main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 2.5rem 1rem 4rem;
}

/* Karten & Auth-Formulare */
.auth-wrap { max-width: 460px; margin: 0 auto; }
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}
.card__header {
    background: linear-gradient(180deg, #dceef5 0%, #e8f3ec 100%);
    padding: 1.75rem 2rem 1.25rem;
    border-bottom: 4px solid var(--accent);
}
.card__header h1 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    margin: 0;
    line-height: 1.3;
}
.card__header p { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.95rem; }
.card__body { padding: 1.75rem 2rem 2rem; }

.field { margin-bottom: 1.1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.field label { display: block; font-weight: 600; font-size: 0.875rem; margin-bottom: 0.35rem; }
.field input[type=text],
.field input[type=email],
.field input[type=password] {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font: inherit;
    font-size: 1rem;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.field--invalid input { border-color: var(--danger); }
.field__error { color: var(--danger); font-size: 0.85rem; margin-top: 0.3rem; }
.field__hint { color: var(--muted); font-size: 0.8rem; margin-top: 0.3rem; }
.checkbox { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }

/* Honeypot – für Menschen unsichtbar */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.8rem 1.6rem;
    border: none;
    border-radius: 30px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, transform .15s;
}
.btn:hover { background: var(--accent-dark); }
.btn--full { width: 100%; }
.btn--ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--border); }
.btn--ghost:hover { background: #f0f4f1; }
.btn--link { background: none; border: none; padding: 0; color: var(--navy); font-weight: 600; cursor: pointer; font: inherit; }

.alert { padding: 0.85rem 1rem; border-radius: 10px; margin-bottom: 1.25rem; font-size: 0.925rem; }
.alert--success { background: #e8f5e9; color: #1b5e20; }
.alert--error { background: #fdecea; color: #8a1c12; }

.divider { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); font-size: 0.85rem; margin: 1.25rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

.auth-links { margin-top: 1.25rem; text-align: center; font-size: 0.9rem; display: grid; gap: 0.4rem; }

.hero {
    background: linear-gradient(180deg, #dceef5 0%, #e8f3ec 100%);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
}
.hero h1 { font-family: var(--font-display); font-size: 2.2rem; margin: 0 0 0.5rem; }
.hero p { color: var(--muted); margin: 0 0 1.5rem; }

@media (max-width: 560px) {
    .site-header__inner { flex-wrap: nowrap; }
    .site-logo { font-size: 1.15rem; }
    .site-nav { gap: 0.75rem; flex-wrap: nowrap; }
    .site-nav a, .site-nav .btn--link { font-size: 0.875rem; }
    .site-nav .btn { padding: 0.5rem 1rem; font-size: 0.875rem; }
    .card__header, .card__body { padding-left: 1.25rem; padding-right: 1.25rem; }
    .field-row { grid-template-columns: 1fr; gap: 0; }
    .hero h1 { font-size: 1.7rem; }
}

/* ---------- Kurse ---------- */
.page-title { font-family: var(--font-display); font-size: 2rem; margin: 0 0 1.5rem; }
.section-title { font-family: var(--font-display); font-size: 1.35rem; margin: 2rem 0 1rem; }
.muted { color: var(--muted); }
.badge { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: 999px; background: #e8f5e9; color: #1b5e20; white-space: nowrap; }
.alert--warning { background: #fff8e1; color: #7a5a00; }
.alert--info { background: #e8f1fb; color: #1d3f72; }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.course-card { display: flex; flex-direction: column; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06); text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.course-card:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1); }
.course-card__image { aspect-ratio: 1200 / 628; background: linear-gradient(180deg, #dceef5 0%, #e8f3ec 100%); }
.course-card__image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.course-card__body { padding: 1.25rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.course-card__body h2 { font-family: var(--font-display); font-size: 1.25rem; margin: 0; line-height: 1.3; }
.course-card__body p { margin: 0; color: var(--muted); font-size: 0.925rem; }
.course-card__meta { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.course-card__cta { margin-top: auto; padding-top: 0.5rem; font-weight: 700; color: var(--navy); }

.course-hero { display: grid; grid-template-columns: 1fr minmax(0, 420px); gap: 2rem; align-items: center; background: linear-gradient(180deg, #dceef5 0%, #e8f3ec 100%); border-radius: var(--radius); padding: 2.25rem; margin-bottom: 1.75rem; }
.course-hero h1 { font-family: var(--font-display); font-size: 2.2rem; line-height: 1.2; margin: 0.5rem 0; }
.course-hero__excerpt { color: #3d4a5c; font-size: 1.05rem; margin: 0; }
.course-hero__image { width: 100%; border-radius: 12px; display: block; }
.breadcrumb { font-size: 0.875rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumb a { color: var(--navy); font-weight: 600; text-decoration: none; }

.tabs { background: #fff; border-radius: var(--radius); box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06); padding: 0 1.75rem 2rem; display: flex; flex-wrap: wrap; }
.tabs > input { position: absolute; opacity: 0; pointer-events: none; }
.tabs > label { padding: 1rem 0.25rem 0.8rem; margin-right: 1.5rem; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; }
.tabs > input:checked + label { color: var(--text); border-bottom-color: var(--accent); }
.tabs__panel { display: none; width: 100%; border-top: 1px solid var(--border); padding-top: 1.5rem; }
#tab-content:checked ~ .tabs__panel--content, #tab-materials:checked ~ .tabs__panel--materials { display: block; }

.prose { font-size: 1.02rem; }
.prose img { max-width: 100%; height: auto; border-radius: 8px; }
.prose iframe { max-width: 100%; }
.prose h2, .prose h3 { font-family: var(--font-display); }

.toc { display: flex; flex-direction: column; gap: 0.5rem; }
.toc__section { margin-top: 1rem; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.toc__item { display: flex; align-items: center; gap: 0.6rem; padding: 0.8rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
details.toc__item { display: block; padding: 0; }
details.toc__item > summary { display: flex; align-items: center; gap: 0.6rem; padding: 0.8rem 1rem; cursor: pointer; list-style: none; }
details.toc__item > summary::-webkit-details-marker { display: none; }
details.toc__item > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
details.toc__item:not([open]) > summary::after { transform: rotate(-90deg); }
.toc__children { display: flex; flex-direction: column; gap: 0.35rem; padding: 0 1rem 0.8rem 2rem; }
.toc__children .toc__item { padding: 0.55rem 0.8rem; font-size: 0.95rem; }
.toc__type { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); min-width: 4.5rem; }
.toc__title { font-weight: 600; color: var(--text); text-decoration: none; }
a.toc__title:hover { color: var(--accent); }
.toc__title--locked { color: var(--muted); }
.toc__lock { font-size: 0.8rem; }
.toc__count { font-size: 0.75rem; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 0.1rem 0.5rem; }

.step { max-width: 860px; margin: 0 auto; }
.step h1 { font-family: var(--font-display); font-size: 2rem; margin: 0.25rem 0 1.25rem; }
.step__type { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.step-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }

@media (max-width: 800px) {
    .course-hero { grid-template-columns: 1fr; padding: 1.5rem; }
    .course-hero h1 { font-size: 1.7rem; }
    .tabs { padding: 0 1.1rem 1.5rem; }
    .toc__children { padding-left: 1rem; }
    .toc__item, details.toc__item > summary { flex-wrap: wrap; row-gap: 0.1rem; }
    .toc__type { min-width: 0; width: 100%; }
    .toc__title { flex: 1; }
}

/* ---------- Fortschritt & Einschreibung ---------- */
.badge--info { background: #e8f1fb; color: #1d3f72; }
.progress { height: 10px; border-radius: 999px; background: #e6ece8; overflow: hidden; }
.progress--small { height: 6px; width: 120px; }
.progress__bar { height: 100%; background: var(--progress, var(--accent)); border-radius: 999px; transition: width .3s; }
.progress__label { font-size: 0.85rem; color: var(--muted); margin: 0.35rem 0 1rem; }

.course-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.75rem; align-items: start; }
.course-layout > .tabs { grid-column: 1; grid-row: 1; }
.enroll-box { grid-column: 2; grid-row: 1; position: sticky; top: 1.5rem; background: #fff; border-radius: var(--radius); box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06); padding: 1.5rem; }
.enroll-box__status { margin-bottom: 0.75rem; }
.enroll-box__price { margin-bottom: 1rem; }
.enroll-box__amount { display: block; font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; }
.enroll-box__period { color: var(--muted); font-size: 0.9rem; }
.enroll-box__note { color: var(--muted); font-size: 0.9rem; margin: 0.75rem 0 0; }
.enroll-box__link { display: block; text-align: center; font-size: 0.875rem; margin-top: 0.75rem; }
.enroll-box__list { margin: 0.5rem 0 0; padding-left: 1.2rem; font-size: 0.9rem; }
.enroll-box__facts { list-style: none; margin: 1.25rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--border); display: grid; gap: 0.4rem; font-size: 0.875rem; color: #3d4a5c; }
.enroll-box__facts li::before { content: "•"; color: var(--accent); margin-right: 0.5rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.toc__check { width: 1.35rem; height: 1.35rem; flex: 0 0 1.35rem; border-radius: 50%; border: 2px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: #fff; }
.toc__check--done { background: var(--progress, var(--accent)); border-color: var(--progress, var(--accent)); }
.toc__hint { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }

.complete-box { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0 0; padding: 1.25rem; background: #fff; border-radius: var(--radius); box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06); text-align: center; }
.complete-box form { margin: 0; }
.complete-box p { margin: 0; width: 100%; }

.video { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; margin-bottom: 1.5rem; }
.video iframe, .video video, .video #step-video-player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.account-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.account-stat { background: #fff; border-radius: 12px; padding: 1rem 1.25rem; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05); }
.account-stat strong { display: block; font-family: var(--font-display); font-size: 1.6rem; }
.account-stat span { color: var(--muted); font-size: 0.85rem; }
.my-course { display: grid; grid-template-columns: minmax(0, 1fr) 200px auto; gap: 1rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.my-course h3 { margin: 0; font-size: 1.05rem; }
.my-course small { color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; align-items: center; }
.filters input, .filters select { padding: 0.55rem 0.8rem; border: 1.5px solid var(--border); border-radius: 10px; font: inherit; background: #fff; }
.course-card__progress { margin-top: 0.5rem; }

/* ---------- Focus Mode ---------- */
body.focus { background: #fff; }
.focus__toggle-input { position: absolute; opacity: 0; pointer-events: none; }
.focus__bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem; padding: 0.65rem 1rem; background: #fff; border-bottom: 1px solid var(--border); }
.focus__toggle { cursor: pointer; font-size: 1.25rem; padding: 0.2rem 0.5rem; border-radius: 8px; }
.focus__toggle:hover { background: var(--bg); }
.focus__logo { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--navy); text-decoration: none; }
.focus__logo img { max-height: 36px; display: block; }
.focus__progress { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--muted); margin-left: auto; }
.focus__arrows { display: flex; gap: 1rem; font-size: 0.9rem; font-weight: 600; }
.focus__arrows a { text-decoration: none; }
.focus__user { position: relative; font-size: 0.9rem; font-weight: 600; }
.focus__user summary { cursor: pointer; list-style: none; padding: 0.35rem 0.75rem; border-radius: 999px; background: var(--bg); }
.focus__menu { position: absolute; right: 0; top: calc(100% + 0.4rem); background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.1); padding: 0.4rem; min-width: 200px; display: grid; }
.focus__menu a, .focus__menu button { display: block; padding: 0.55rem 0.75rem; border-radius: 8px; text-decoration: none; color: var(--text); background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.focus__menu a:hover, .focus__menu button:hover { background: var(--bg); }
.focus__body { display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: calc(100vh - 57px); }
.focus--right .focus__body { grid-template-columns: minmax(0, 1fr) 320px; }
.focus--right .focus__sidebar { order: 2; border-right: 0; border-left: 1px solid var(--border); }
.focus__sidebar { background: var(--bg); border-right: 1px solid var(--border); padding: 1rem; overflow-y: auto; max-height: calc(100vh - 57px); position: sticky; top: 57px; }
.focus__toggle-input:checked ~ .focus__body { grid-template-columns: minmax(0, 1fr); }
.focus__toggle-input:checked ~ .focus__body .focus__sidebar { display: none; }
.focus__course a { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; margin-bottom: 1rem; }
.fnav__section { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1rem 0 0.4rem; }
.fnav__item { display: flex; align-items: center; gap: 0.55rem; padding: 0.45rem 0.5rem; border-radius: 8px; font-size: 0.9rem; }
.fnav__item a { color: var(--text); text-decoration: none; }
.fnav__item--lesson { font-weight: 600; }
.fnav__item--current { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.fnav__item--current a { color: var(--accent); }
.fnav__locked { color: var(--muted); }
.fnav__children { margin-left: 1rem; }
.focus__main { padding: 2rem 1.25rem 4rem; }
.focus__content { max-width: var(--focus-width); margin: 0 auto; }
.step__title { font-family: var(--font-display); font-size: 2rem; margin: 0.25rem 0 1.25rem; }

@media (max-width: 900px) {
    .course-layout { grid-template-columns: 1fr; }
    .enroll-box { grid-column: 1; grid-row: auto; position: static; }
    .course-layout > .tabs { grid-row: auto; }
    .my-course { grid-template-columns: 1fr; }
    .focus__body, .focus--right .focus__body { grid-template-columns: 1fr; }
    .focus__sidebar { display: none; position: static; max-height: none; }
    .focus__toggle-input:checked ~ .focus__body .focus__sidebar { display: block; }
    .focus__progress .progress { display: none; }
    .focus__logo { display: none; }
}

/* Tabellen (Konto: Bestellungen) */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; color: #6c757d; border-bottom: 2px solid #e2e6ea; padding: 0.5rem; }
.table td { border-bottom: 1px solid #edf0f2; padding: 0.6rem 0.5rem; vertical-align: top; }
.table small { color: #6c757d; }
.table .btn--link { color: #b91c1c; font-size: 0.85rem; margin-left: 0.5rem; }

/* Eingebettete Videos im Inhalt ([video URL]) */
.prose .embed { position: relative; aspect-ratio: 16 / 9; margin: 1.25rem 0; border-radius: 10px; overflow: hidden; background: #000; }
.prose .embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose .embed-video { width: 100%; margin: 1.25rem 0; border-radius: 10px; }
.prose .embed-audio { width: 100%; margin: 1rem 0; }
