/* ===================================================================
   Design Finder — Stylesheet
   Warm mediterranean palette, mobile-first, modern with soft serifs.
   =================================================================== */

:root {
  /* Palette */
  --bg-cream:    #fcfaf6;
  --bg-warm:     #f5efe4;
  --ink:         #2a2522;
  --ink-dim:     #6b6560;
  --ink-faint:   #a8a39d;
  --accent:      #a87958;  /* warmes Bronze/Rosenholz */
  --accent-dark: #8a5e3f;
  --accent-soft: #d4ad95;
  --accent-bg:   #f7ede3;
  --border:      #e8e2d5;
  --border-soft: #f0ebe0;
  --danger:      #b94a48;
  --success:     #5b8a47;
  --shadow-card: 0 20px 60px -20px rgba(42, 37, 34, 0.18),
                 0 2px 8px rgba(42, 37, 34, 0.04);
  --shadow-card-hover: 0 30px 70px -20px rgba(42, 37, 34, 0.22),
                       0 4px 12px rgba(42, 37, 34, 0.06);

  /* Typography */
  --f-serif: 'Cormorant Garamond', Georgia, serif;
  --f-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg-cream);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ===================================================================
   HEADER
   =================================================================== */
.site-header {
  background: rgba(252, 250, 246, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--f-serif);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  font-weight: 500;
}
.brand-mark {
  color: var(--accent);
  font-size: 1.15rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.92rem;
}
.site-nav a {
  color: var(--ink-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--accent-dark);
  border-bottom-color: var(--accent);
}
.site-nav .nav-secondary { color: var(--ink-faint); }

.lang-toggle {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink-dim) !important;
}
.lang-toggle:hover {
  border-color: var(--accent);
  color: var(--accent-dark) !important;
}

@media (max-width: 480px) {
  .site-nav { gap: 0.75rem; font-size: 0.85rem; }
  .brand-text { display: none; }
}

/* ===================================================================
   HERO / Page-Layouts
   =================================================================== */
.site-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hero {
  position: relative;
  flex: 1;                  /* füllt den verfügbaren Platz bis zum Footer */
  min-height: 60vh;         /* Mindesthöhe für sehr lange Viewports */
  display: flex;
  align-items: center;
  padding: 3rem 0 4rem;
  overflow: hidden;
}
.hero-narrow { min-height: 50vh; }

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('/img/bg-fotobox.webp');
  background-size: cover;
  background-position: center;
  filter: saturate(0.65) brightness(0.45);
  z-index: -2;
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(252, 250, 246, 0.0) 0%,
    rgba(252, 250, 246, 0.35) 50%,
    rgba(252, 250, 246, 0.9) 100%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero-card {
  max-width: 760px;
  margin: 0 auto;
  background: rgba(252, 250, 246, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 6px;
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow-card);
}
.hero-card-narrow { max-width: 520px; }

@media (max-width: 600px) {
  .hero-card { padding: 2rem 1.5rem; }
}

.kicker {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.7rem;
}

.hero-title {
  font-family: var(--f-serif);
  font-weight: 500;
  font-size: clamp(1.85rem, 4.5vw, 2.85rem);
  line-height: 1.15;
  margin: 0 0 1rem;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.hero-lead {
  font-size: 1.08rem;
  color: var(--ink-dim);
  margin: 0 0 2rem;
  max-width: 56ch;
}

/* ===================================================================
   LOBBY BLOCKS
   =================================================================== */
.lobby-blocks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}
@media (max-width: 720px) {
  .lobby-blocks { grid-template-columns: 1fr; gap: 1.25rem; }
}

.lobby-block {
  padding: 1.75rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-cream);
  display: flex;
  flex-direction: column;
}
.lobby-block-primary {
  background: var(--accent-bg);
  border-color: var(--accent-soft);
}
.lobby-block h2 {
  font-family: var(--f-serif);
  font-size: 1.3rem;
  font-weight: 500;
  margin: 0.75rem 0 0.5rem;
  letter-spacing: -0.005em;
}
.lobby-block p {
  font-size: 0.95rem;
  color: var(--ink-dim);
  margin: 0 0 1.25rem;
  flex: 1;
}

.lobby-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(168, 121, 88, 0.12);
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lobby-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-dim);
  margin: 0 0 0.4rem;
}
.lobby-form input[type="email"] {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font: inherit;
  font-size: 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--ink);
  margin-bottom: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.lobby-form input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(168, 121, 88, 0.15);
}
.lobby-form .btn { width: 100%; }

/* ===================================================================
   BUTTONS
   =================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.4rem;
  font: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -6px rgba(168, 121, 88, 0.4);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-dim);
  border-color: var(--border);
}
.btn-ghost:hover {
  color: var(--accent-dark);
  border-color: var(--accent);
}
.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(185, 74, 72, 0.25);
}
.btn-danger:hover {
  background: rgba(185, 74, 72, 0.08);
  border-color: var(--danger);
}
.btn-success {
  background: var(--success) !important;
  color: #fff !important;
  border-color: var(--success) !important;
}
.btn-lg {
  padding: 0.95rem 1.8rem;
  font-size: 1.02rem;
}
.btn-small {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
}

.cta-row {
  margin: 1.5rem 0;
}

/* ===================================================================
   HELP BLOCK / STEPS
   =================================================================== */
.help-block {
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-soft);
}
.help-block h3 {
  font-family: var(--f-serif);
  font-size: 1.2rem;
  font-weight: 500;
  margin: 0 0 1rem;
  color: var(--ink);
}
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.8rem;
}
.steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  font-size: 0.97rem;
  color: var(--ink-dim);
}
.step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.step-text strong { color: var(--ink); font-weight: 600; }

/* ===================================================================
   ICONS
   =================================================================== */
.icon-large {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 1.5rem;
}
.icon-warn {
  background: rgba(185, 74, 72, 0.1);
  color: var(--danger);
}
.icon-success {
  background: rgba(91, 138, 71, 0.1);
  color: var(--success);
}

/* ===================================================================
   DESIGNS PAGE
   =================================================================== */
.designs-page {
  padding: 2.5rem 0 4rem;
}
.page-head {
  margin-bottom: 1.75rem;
}
.page-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-head h1 {
  font-family: var(--f-serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 0.5rem;
  color: var(--ink);
}
.page-lead {
  color: var(--ink-dim);
  margin: 0;
  font-size: 1rem;
}

.iframe-wrap {
  position: relative;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  min-height: 400px;
}
.iframe-wrap iframe {
  display: block;
  width: 100%;
  border: 0;
}
.iframe-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--bg-cream);
  color: var(--ink-dim);
  font-size: 0.95rem;
  z-index: 1;
}
.iframe-loading.hidden { display: none; }
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================================================================
   ADMIN
   =================================================================== */
.admin-section { padding: 2.5rem 0 4rem; }

.admin-login-form,
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 1.5rem;
}
.admin-login-form label,
.admin-form label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-dim);
  margin-top: 0.6rem;
}
.admin-login-form input,
.admin-form input,
.admin-form textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font: inherit;
  font-size: 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--ink);
  margin-bottom: 0.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: var(--f-sans);
}
.admin-form textarea { resize: vertical; min-height: 60px; }
.admin-login-form input:focus,
.admin-form input:focus,
.admin-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(168, 121, 88, 0.15);
}
.admin-login-form .btn { margin-top: 1.2rem; }
.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Alert */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  margin: 1rem 0 0;
}
.alert-error {
  background: rgba(185, 74, 72, 0.08);
  color: var(--danger);
  border: 1px solid rgba(185, 74, 72, 0.2);
}

/* Created-Banner */
.created-banner {
  background: linear-gradient(135deg, var(--accent-bg) 0%, #fff5ed 100%);
  border: 1px solid var(--accent-soft);
  border-radius: 6px;
  padding: 1.5rem 1.75rem;
  margin: 0 0 2rem;
}
.created-banner h2 {
  margin: 0 0 0.4rem;
  font-family: var(--f-serif);
  font-weight: 500;
  font-size: 1.4rem;
  color: var(--accent-dark);
}
.created-banner p { margin: 0 0 1rem; color: var(--ink-dim); }

.link-display {
  display: flex;
  gap: 0.5rem;
}
.link-display input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.85rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--ink);
}
.link-hint {
  margin: 0.7rem 0 0;
  font-size: 0.85rem;
  color: var(--success);
  font-weight: 500;
}

@media (max-width: 600px) {
  .link-display { flex-direction: column; }
}

/* Tabelle */
.table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
}
.customers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.customers-table th,
.customers-table td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
.customers-table th {
  background: var(--bg-warm);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.customers-table tr:last-child td { border-bottom: none; }
.customers-table tr.is-disabled { opacity: 0.55; }
.customers-table .text-muted { color: var(--ink-faint); }
.customers-table .col-actions {
  white-space: nowrap;
  text-align: right;
}
.customers-table .col-actions form,
.customers-table .col-actions button {
  margin-left: 0.3rem;
}
.note {
  font-size: 0.8rem;
  color: var(--ink-faint);
  font-style: italic;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}
.badge-warn {
  background: rgba(185, 74, 72, 0.1);
  color: var(--danger);
}

.empty-state {
  padding: 4rem 2rem;
  text-align: center;
  color: var(--ink-faint);
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 6px;
}

/* ===================================================================
   FOOTER
   =================================================================== */
.site-footer {
  background: var(--bg-warm);
  border-top: 1px solid var(--border-soft);
  padding: 1.5rem 0;
  margin-top: auto;
}
.site-footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-faint);
  text-align: center;
}

/* ===================================================================
   ACCESSIBILITY
   =================================================================== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Setup-Hint */
.hint {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin: 0.2rem 0 0.6rem;
  font-style: italic;
}

/* ===================================================================
   DESIGNS-SEITE: breiter Container + Filter-Erklärung über dem iframe
   =================================================================== */

/* Designs-Seite nutzt mehr Bildschirmbreite, damit der iframe mehr
   Spalten anzeigen kann (im alten Layout waren 6+ Spalten sichtbar) */
.container-wide {
  max-width: 1500px;
}

/* Filter-Legende: 5 Spalten Erklärung, was die iframe-Filter bedeuten */
.filter-legend {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  margin: 0 0 2rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

.filter-legend-col {
  min-width: 0;  /* erlaubt Wrapping in Grid-Cells */
}

.filter-legend-label {
  display: inline-block;
  background: var(--bg-warm);
  color: var(--accent-dark);
  font-family: var(--f-serif);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.45rem 1rem;
  border-radius: 3px;
  margin: 0 0 0.85rem;
  letter-spacing: 0.005em;
}

.filter-legend-body {
  font-size: 0.88rem;
  color: var(--ink-dim);
  line-height: 1.55;
}

.filter-legend-body strong {
  color: var(--ink);
  font-weight: 600;
}

/* Mobile: erst auf 2 Spalten, ganz schmal: 1 Spalte */
@media (max-width: 900px) {
  .filter-legend {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}
@media (max-width: 480px) {
  .filter-legend {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ===================================================================
   ADMIN DIAGNOSE-SEITE
   =================================================================== */
.hero-card-wide { max-width: 720px; }

.diag-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-soft);
}
.diag-section:first-of-type { border-top: none; padding-top: 0; }

.diag-h2 {
  font-family: var(--f-serif);
  font-size: 1.35rem;
  font-weight: 500;
  margin: 0 0 1rem;
  color: var(--accent-dark);
  letter-spacing: 0.005em;
}

.diag-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 1.5rem;
  margin: 0;
  font-size: 0.95rem;
}
.diag-list dt { font-weight: 600; color: var(--ink); }
.diag-list dd { margin: 0; color: var(--ink-dim); word-break: break-word; }
.diag-list dd code { background: rgba(0,0,0,0.04); padding: 0.1em 0.4em; border-radius: 3px; font-size: 0.9em; }

.diag-ok   { color: #2d7a3a; font-weight: 500; }
.diag-warn { color: #b8721d; font-weight: 500; }
.diag-fail { color: #b73e35; font-weight: 500; }

.diag-text { color: var(--ink-dim); font-size: 0.9rem; line-height: 1.55; }
.diag-form { margin-top: 1rem; }

.diag-result {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: 4px;
  border-left: 4px solid;
  font-size: 0.92rem;
}
.diag-result p { margin: 0.4rem 0; }
.diag-result pre {
  background: rgba(0,0,0,0.05);
  padding: 0.75rem;
  border-radius: 3px;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0.5rem 0;
}
.diag-result code { background: rgba(0,0,0,0.05); padding: 0.1em 0.4em; border-radius: 3px; }
.diag-result-ok   { background: #f2faf3; border-color: #2d7a3a; color: #1f5828; }
.diag-result-fail { background: #fdf5f4; border-color: #b73e35; color: #8e2e26; }

.diag-back { text-align: center; margin-top: 2rem; }

@media (max-width: 600px) {
  .diag-list { grid-template-columns: 1fr; gap: 0.2rem 0; }
  .diag-list dt { margin-top: 0.75rem; }
  .diag-list dd { padding-left: 0.5rem; }
}

/* ===================================================================
   UTILITIES (ersetzen ehemalige Inline-Styles, damit die CSP strikt
   bleiben kann)
   =================================================================== */
.form-inline { display: inline; }
.btn-toolbar { margin-left: 0.5rem; }
