/* =========================================================================
   HomeShowing – Stil
   Fundament: hellgrauer Hintergrund, weiße Karten mit abgerundeten Ecken.
   ========================================================================= */

:root {
    --bg:        #f3f4f6;
    --card:      #ffffff;
    --text:      #1f2937;
    --muted:     #6b7280;
    --border:    #e5e7eb;
    --border-2:  #d1d5db;
    --accent:    #2563eb;
    --accent-ink:#1d4ed8;
    --accent-50: #eff6ff;
    --danger:    #dc2626;
    --ok:        #16a34a;
    --radius:    16px;
    --radius-sm: 10px;
    --shadow:    0 1px 3px rgba(17, 24, 39, .06), 0 1px 2px rgba(17, 24, 39, .04);
    --shadow-lg: 0 12px 32px rgba(17, 24, 39, .10);
}

* { box-sizing: border-box; }

/* Das hidden-Attribut muss class-basierte display-Regeln (flex etc.) schlagen. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 20px 16px 48px;
}

/* ---------- Karten ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 18px;
}
@media (min-width: 600px) { .card { padding: 26px; } }

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 16px;
}
.section-title .icon { color: var(--accent); }

.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 8px 0; }

/* ---------- Hero ---------- */
.hero { padding: 0; overflow: hidden; }
.hero-photo {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    border: 0;
    padding: 0;
    background-size: cover;
    background-position: center;
    background-color: #e5e7eb;
    cursor: pointer;
}
.hero-photo.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--muted);
    cursor: default;
    font-size: .9rem;
}
.hero-body { padding: 20px; }
@media (min-width: 600px) { .hero-body { padding: 26px; } }

.hero-body h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.5rem, 5vw, 2.1rem);
    line-height: 1.2;
    margin: 0 0 10px;
    letter-spacing: -0.01em;
}
.location {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    margin: 0 0 14px;
}
.price {
    font-size: clamp(1.5rem, 6vw, 2rem);
    font-weight: 700;
    color: var(--accent-ink);
    font-variant-numeric: tabular-nums;
    margin: 0 0 18px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .18s ease, border-color .18s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border-2);
}
.btn-ghost:hover { background: #f9fafb; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- Eckdaten ---------- */
.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 12px;
}
.fact {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px;
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 12px;
}
.fact-icon { color: var(--accent); }
.fact-value { font-weight: 600; font-size: 1.02rem; }
.fact-value.accent { color: var(--accent-ink); }
.fact-label { font-size: .8rem; color: var(--muted); }

/* ---------- Galerie ---------- */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}
.gallery-item {
    border: 0;
    padding: 0;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    background-color: #e5e7eb;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}
.gallery-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ---------- Beschreibung ---------- */
.description p { margin: 0 0 14px; }
.description p:last-child { margin-bottom: 0; }
.features-title { font-size: 1rem; font-weight: 600; margin: 20px 0 10px; }
.features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px 18px;
}
.features li { display: flex; align-items: center; gap: 8px; }
.features .icon { color: var(--ok); flex: 0 0 auto; }

/* ---------- Ausstattung im Detail ---------- */
.equipment { margin: 0; display: grid; gap: 14px; }
.equip-item { padding-left: 14px; border-left: 3px solid var(--accent); }
.equip-item dt { font-weight: 600; margin-bottom: 2px; }
.equip-item dd { margin: 0; color: #374151; }

/* ---------- Dokumente ---------- */
.documents { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.documents a {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 16px;
    border: 1px solid var(--border); border-radius: 12px;
    background: #f9fafb; color: var(--text); text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease;
}
.documents a:hover { border-color: var(--accent); background: var(--accent-50); }
.documents a > .icon:first-child { color: var(--accent); flex: 0 0 auto; }
.documents .doc-label { font-weight: 600; flex: 1 1 auto; }
.documents .doc-size { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.documents a > .icon-sm { color: var(--muted); flex: 0 0 auto; }

/* ---------- Buchung ---------- */
.step-label { font-weight: 600; font-size: .95rem; margin: 18px 0 10px; }
.step-label:first-child { margin-top: 0; }

.date-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
    min-height: 44px;
    padding: 8px 16px;
    border: 1px solid var(--border-2);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.pill:hover { border-color: var(--accent); }
.pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
    gap: 8px;
}
.slot {
    min-height: 44px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    font: inherit;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}
.slot:hover { border-color: var(--accent); background: var(--accent-50); }
.slot.taken {
    color: var(--muted);
    text-decoration: line-through;
    background: #f3f4f6;
    border-color: var(--border);
    cursor: not-allowed;
}
/* Offene Besichtigung: ein Sammeltermin über die volle Breite. */
.slot-open {
    grid-column: 1 / -1;
    min-height: 52px;
    font-weight: 600;
    color: var(--accent-ink);
    border-color: var(--accent);
    background: var(--accent-50);
}
.slot-open:hover { background: #dbeafe; border-color: var(--accent-ink); }

/* ---------- Formular ---------- */
.booking-form { margin-top: 4px; }
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: none;
    color: var(--accent-ink);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 0;
    margin-bottom: 12px;
}
.chosen-slot {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-50);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-weight: 600;
    color: var(--accent-ink);
    margin-bottom: 18px;
}
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 500; margin-bottom: 6px; font-size: .95rem; }
.req { color: var(--danger); }
.opt { color: var(--muted); font-weight: 400; font-size: .85rem; }
.field input, .field textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    font: inherit;
    color: var(--text);
    background: #fff;
}
.field textarea { min-height: auto; resize: vertical; }
.field input:focus, .field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.field input.invalid, .field textarea.invalid { border-color: var(--danger); }
.field-error { display: block; color: var(--danger); font-size: .85rem; margin-top: 5px; min-height: 1em; }
.form-error {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--danger);
    font-weight: 500;
    margin: 0 0 12px;
}
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- Bestätigung ---------- */
.confirmation { text-align: center; padding: 16px 8px; }
.confirm-icon { color: var(--ok); display: flex; justify-content: center; margin-bottom: 8px; }
.confirmation h3 { margin: 0 0 6px; font-size: 1.3rem; }
.confirm-slot {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--accent-ink);
    margin: 10px 0 14px;
}

/* ---------- Admin ---------- */
.login-card { max-width: 380px; margin: 48px auto 0; text-align: center; }
.card-icon { display: flex; justify-content: center; color: var(--accent); margin-bottom: 10px; }
.login-title { margin: 0 0 6px; }
.login-card form { margin-top: 18px; text-align: left; }
.login-card label { display: block; font-weight: 500; margin-bottom: 6px; }
.login-card input {
    width: 100%; min-height: 46px; padding: 11px 13px;
    border: 1px solid var(--border-2); border-radius: var(--radius-sm);
    font: inherit; margin-bottom: 14px;
}
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.admin-head h1 { margin: 0; font-size: 1.5rem; }

.warn-card {
    display: flex; align-items: flex-start; gap: 12px;
    background: #fffbeb; border-color: #fde68a; color: #92400e;
}
.warn-card .icon { flex: 0 0 auto; color: #d97706; }
.warn-card code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; }

.table-wrap { overflow-x: auto; }
table.bookings { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.bookings th, table.bookings td {
    text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top;
}
table.bookings th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
table.bookings tr:last-child td { border-bottom: 0; }
.nowrap { white-space: nowrap; }
table.bookings a { color: var(--accent-ink); }

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(15, 23, 42, .92);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.lightbox-close, .lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    border: 0; background: rgba(255,255,255,.12); color: #fff;
    width: 48px; height: 48px; border-radius: 999px;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.lightbox-close { top: 18px; right: 18px; transform: none; }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }
.lightbox-nav:hover, .lightbox-close:hover { background: rgba(255,255,255,.25); }

/* ---------- Footer ---------- */
.page-footer { text-align: center; padding: 12px; }
.page-footer p { font-size: .85rem; margin: 0; }

/* ---------- Icons ---------- */
.icon { width: 24px; height: 24px; }
.icon-sm { width: 18px; height: 18px; }
.icon-xl { width: 48px; height: 48px; }

/* ---------- Fokus & Bewegung ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
