/* =========================================================================
   Lausitzer Kaffeeservice – Konfigurator
   Neutrales Design, CSS-Variablen fuer spaeteren CI-Tausch.
   ========================================================================= */

:root {
    --c-bg:           #f5f6f8;
    --c-surface:      #ffffff;
    --c-surface-alt:  #f0f2f5;
    --c-border:       #d8dde3;
    --c-border-strong:#b9c0c8;
    --c-text:         #1f2933;
    --c-text-muted:   #5a6470;
    --c-text-soft:    #8993a0;
    --c-primary:      #1f2933;
    --c-primary-hov:  #0f1820;
    --c-accent:       #b58a3f;       /* dezentes Bronze als „Kaffee"-Akzent */
    --c-accent-hov:   #9d7732;
    --c-success:      #2f8f5e;
    --c-error:        #c0392b;

    --r-sm: 4px;
    --r-md: 8px;
    --r-lg: 12px;

    --shadow-sm: 0 1px 2px rgba(20, 25, 35, .06);
    --shadow-md: 0 4px 16px rgba(20, 25, 35, .08);

    --max-w: 1180px;

    --f-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Reset / Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--f-sans);
    font-size: 16px;
    line-height: 1.5;
    color: var(--c-text);
    background: var(--c-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: var(--c-accent); text-decoration: none; }
a:hover { color: var(--c-accent-hov); text-decoration: underline; }

button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

.container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Header ---------- */
.site-header {
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}
.brand-mark {
    width: 36px; height: 36px;
    border-radius: var(--r-md);
    background: var(--c-primary);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
    letter-spacing: -.5px;
}
.brand-mark span { color: var(--c-accent); }
.brand-name { font-size: 16px; }
.step-indicator {
    color: var(--c-text-muted);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}
.progress {
    height: 3px;
    background: var(--c-surface-alt);
}
.progress-bar {
    height: 100%;
    background: var(--c-accent);
    width: 0%;
    transition: width .3s ease;
}

/* ---------- Layout ---------- */
.layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    padding-top: 32px;
    padding-bottom: 120px;
    flex: 1;
}
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; gap: 20px; padding-bottom: 140px; }
}

/* ---------- Wizard / Steps ---------- */
.wizard { min-width: 0; }
.step { display: none; }
.step.is-active { display: block; }
.step-title {
    font-size: 26px;
    line-height: 1.2;
    margin: 0 0 8px;
    font-weight: 600;
}
.step-lead {
    color: var(--c-text-muted);
    margin: 0 0 24px;
}

/* ---------- Option-Grid (Karten-Auswahl) ---------- */
.option-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.option-grid.grid-cols-2 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.option-grid.grid-cols-3 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.option-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
    user-select: none;
}
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card:hover { border-color: var(--c-border-strong); }
.option-card:has(input:checked),
.option-card.is-checked {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 1px var(--c-primary) inset;
    background: var(--c-surface);
}
.option-card.oc-multi:has(input:checked),
.option-card.oc-multi.is-checked { border-color: var(--c-accent); box-shadow: 0 0 0 1px var(--c-accent) inset; }
.option-card.oc-compact { padding: 12px 14px; }
.oc-title { font-weight: 600; font-size: 15px; }
.oc-sub   { color: var(--c-text-muted); font-size: 13px; }
.oc-check {
    position: absolute;
    top: 10px; right: 12px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--c-accent);
    color: #fff;
    display: none;
    align-items: center; justify-content: center;
    font-size: 14px;
    font-weight: 700;
}
.oc-multi:has(input:checked) .oc-check,
.oc-multi.is-checked .oc-check { display: inline-flex; }

.subfield { margin-bottom: 28px; }
.subfield-title {
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 0 0 10px;
    color: var(--c-text-muted);
}

/* ---------- Formular ---------- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field.span-2 { grid-column: span 2; }
.field-label { font-size: 13px; color: var(--c-text-muted); font-weight: 600; }
.req { color: var(--c-error); }

.field input[type=text],
.field input[type=email],
.field input[type=tel],
.field select,
.field textarea {
    border: 1px solid var(--c-border);
    background: var(--c-surface);
    border-radius: var(--r-sm);
    padding: 10px 12px;
    font-size: 15px;
    line-height: 1.4;
    transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(31, 41, 51, .08);
}
.field input.has-error,
.field select.has-error,
.field textarea.has-error { border-color: var(--c-error); }

.field.checkbox {
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    padding: 10px 12px;
}
.field.checkbox input[type=checkbox] { margin-top: 3px; }
.field.checkbox span { font-size: 14px; color: var(--c-text-muted); line-height: 1.4; }
.field.checkbox.has-error { border-color: var(--c-error); }

.honeypot { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; }
    .field.span-2 { grid-column: span 1; }
}

/* ---------- Zusammenfassung ---------- */
.summary {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 18px 20px;
    align-self: start;
    position: sticky;
    top: 88px;
}
.summary-title {
    margin: 0 0 12px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--c-text-muted);
    font-weight: 600;
}
.summary-list {
    margin: 0;
    display: grid;
    gap: 10px;
}
.summary-list dt {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--c-text-soft);
    margin-bottom: 2px;
}
.summary-list dd { margin: 0; font-size: 14px; }
.summary-empty { color: var(--c-text-soft); font-size: 14px; }

@media (max-width: 900px) {
    .summary { position: static; }
}

/* ---------- Buttons ---------- */
.actions {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--c-surface);
    border-top: 1px solid var(--c-border);
    box-shadow: var(--shadow-md);
    z-index: 5;
}
.actions-row {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 14px 20px;
}
.btn {
    border: 1px solid transparent;
    background: var(--c-primary);
    color: #fff;
    border-radius: var(--r-sm);
    padding: 11px 22px;
    font-size: 15px;
    font-weight: 600;
    transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--c-primary-hov); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost {
    background: transparent;
    color: var(--c-text);
    border-color: var(--c-border);
}
.btn-ghost:hover { background: var(--c-surface-alt); border-color: var(--c-border-strong); }
.btn-primary { background: var(--c-primary); }
.btn-sm { padding: 8px 16px; font-size: 14px; }

/* ---------- Buchung / Kalender ---------- */
.booking { display: grid; gap: 18px; }
.booking-loading { color: var(--c-text-muted); }
.booking-empty {
    background: var(--c-surface);
    border: 1px dashed var(--c-border-strong);
    border-radius: var(--r-md);
    padding: 24px;
    text-align: center;
    color: var(--c-text-muted);
}
.day-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.day-chip {
    flex: 0 0 auto;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 10px 14px;
    cursor: pointer;
    text-align: center;
    min-width: 76px;
    transition: border-color .15s, background .15s;
}
.day-chip:hover { border-color: var(--c-border-strong); }
.day-chip.is-active {
    border-color: var(--c-primary);
    background: var(--c-primary);
    color: #fff;
}
.day-chip.is-disabled { opacity: .4; pointer-events: none; }
.day-chip-weekday { display: block; font-size: 12px; color: inherit; opacity: .8; }
.day-chip-date { display: block; font-weight: 700; font-size: 16px; }

.slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}
.slot-btn {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    padding: 10px 12px;
    font-size: 14px;
    text-align: center;
    transition: border-color .15s, background .15s, color .15s;
}
.slot-btn:hover { border-color: var(--c-primary); }
.slot-btn.is-selected {
    background: var(--c-primary);
    color: #fff;
    border-color: var(--c-primary);
}

/* ---------- Bestätigung ---------- */
.confirmation { text-align: center; padding: 40px 20px; }
.confirmation-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--c-success);
    color: #fff;
    margin: 0 auto 18px;
    font-size: 32px;
    display: flex; align-items: center; justify-content: center;
}
.confirmation-summary {
    margin: 24px auto 0;
    max-width: 540px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 20px 22px;
    text-align: left;
}
.confirmation-summary dl { margin: 0; display: grid; gap: 8px; }
.confirmation-summary dt { font-size: 12px; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.confirmation-summary dd { margin: 0 0 6px; font-size: 15px; font-weight: 600; }

/* ---------- Cookiebanner ---------- */
.cookiebanner {
    position: fixed;
    left: 16px; right: 16px; bottom: 16px;
    z-index: 50;
}
.cookiebanner-inner {
    max-width: 720px;
    margin: 0 auto;
    background: var(--c-primary);
    color: #fff;
    border-radius: var(--r-md);
    padding: 16px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    box-shadow: var(--shadow-md);
}
.cookiebanner-inner p { margin: 0; flex: 1 1 320px; font-size: 14px; line-height: 1.5; color: #e6e9ee; }
.cookiebanner-inner a { color: #fff; text-decoration: underline; }

/* ---------- Page-Footer ---------- */
.page-footer {
    border-top: 1px solid var(--c-border);
    background: var(--c-surface);
    padding: 14px 0 80px;
    margin-top: 32px;
    color: var(--c-text-muted);
    font-size: 13px;
}
.page-footer-row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.page-footer nav a { color: var(--c-text-muted); margin-left: 16px; }

/* ---------- Fehler-Box ---------- */
.flash-error {
    background: #fef0ef;
    color: var(--c-error);
    border: 1px solid #f4c2bd;
    border-radius: var(--r-sm);
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* ---------- Statische Seiten (Datenschutz, Impressum, Admin) ---------- */
.static-page {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 32px 36px;
    margin: 32px auto;
    max-width: 800px;
}
.static-page h1 { margin-top: 0; }
.static-page h2 { margin-top: 28px; }
.static-page p, .static-page li { color: var(--c-text); line-height: 1.6; }

/* ---------- Admin ---------- */
.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 220px 1fr;
}
.admin-sidebar {
    background: var(--c-primary);
    color: #fff;
    padding: 24px 18px;
}
.admin-sidebar a {
    display: block;
    color: #d8dde3;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    margin-bottom: 4px;
    font-size: 14px;
}
.admin-sidebar a:hover, .admin-sidebar a.is-active {
    background: rgba(255,255,255,.08);
    color: #fff;
    text-decoration: none;
}
.admin-sidebar h1 { font-size: 16px; margin-bottom: 16px; color: #fff; }
.admin-main { padding: 32px 36px; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-md); overflow: hidden; }
.admin-table th, .admin-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--c-border); font-size: 14px; vertical-align: top; }
.admin-table th { background: var(--c-surface-alt); font-weight: 600; }
.admin-table tr:last-child td { border-bottom: none; }
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: var(--c-surface-alt);
    color: var(--c-text-muted);
}
.badge-neu        { background: #e6f1fb; color: #1e66a0; }
.badge-kontaktiert{ background: #fff3d6; color: #8b6500; }
.badge-angebot    { background: #e7e0fb; color: #5d3eb1; }
.badge-verhandlung{ background: #fde2c4; color: #a65a07; }
.badge-kunde      { background: #d8efe1; color: #1f6c44; }
.badge-verloren   { background: #fadcd9; color: #9a2a1f; }

@media (max-width: 800px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { padding: 14px 16px; }
}

/* ---------- Login ---------- */
.login-card {
    max-width: 360px;
    margin: 80px auto;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 30px 32px;
}
.login-card h1 { margin-top: 0; font-size: 22px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; }
