/* ═══════════════════════════════════════════════════════════════════════
   Hostoria — Design-System
   Light-first, moderne SaaS-Optik. Pro Tenant wird --brand über
   Inline-Styles injiziert (siehe branding.js → cssVarsBlock).
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* Brand (default — wird pro Tenant überschrieben) */
  --brand:            #2563eb;
  --brand-hover:      #1d4ed8;
  --brand-accent:     #f59e0b;
  --brand-on-primary: #ffffff;

  /* Neutrals */
  --bg:        #fafbfc;
  --bg-elev-1: #ffffff;
  --bg-elev-2: #f3f5f8;
  --bg-elev-3: #e8ecf1;
  --text:      #0f172a;
  --text-muted:#475569;
  --text-faint:#94a3b8;
  --border:    #e2e8f0;
  --border-strong: #cbd5e1;

  /* Status */
  --success:   #10b981;
  --danger:    #ef4444;
  --warning:   #f59e0b;
  --info:      #0ea5e9;

  /* Tokens */
  --radius:    10px;
  --radius-lg: 16px;
  --shadow-1:  0 1px 2px rgba(15,23,42,0.04);
  --shadow-2:  0 4px 16px rgba(15,23,42,0.06);
  --shadow-3:  0 12px 32px rgba(15,23,42,0.10);
  --shadow-4:  0 24px 56px rgba(15,23,42,0.14);

  /* Motion */
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { letter-spacing: -0.02em; line-height: 1.2; font-weight: 700; }
h1 { font-size: 2.5rem; font-weight: 800; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.2rem; }
p  { color: var(--text-muted); }

/* ═══════════ Layout-Primitives ═══════════ */
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 720px; margin: 0 auto; padding: 0 24px; }

.section { padding: 80px 0; }
.section--tight { padding: 48px 0; }

.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

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

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.tabular { font-variant-numeric: tabular-nums; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }

/* ═══════════ Buttons ═══════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: 600 0.92rem 'Inter', sans-serif;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: all 160ms var(--ease-smooth);
  user-select: none;
  background: var(--bg-elev-1);
  color: var(--text);
  border-color: var(--border);
}
.btn:hover { background: var(--bg-elev-2); border-color: var(--border-strong); text-decoration: none; }
.btn--primary {
  background: var(--brand);
  color: var(--brand-on-primary);
  border-color: var(--brand);
}
.btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--brand-on-primary); }
.btn--lg { padding: 14px 28px; font-size: 1rem; border-radius: 12px; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--bg-elev-2); }
.btn--danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn--danger:hover { background: #dc2626; border-color: #dc2626; color: #fff; }

/* ═══════════ Forms ═══════════ */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0.01em; }
.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev-1);
  color: var(--text);
  font: 500 0.94rem 'Inter', sans-serif;
  outline: none;
  transition: border-color 140ms, box-shadow 140ms;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 20%, transparent);
}
.input--color { height: 44px; padding: 4px; cursor: pointer; }
.field__hint { font-size: 0.78rem; color: var(--text-faint); margin-top: 2px; }
.field__error { font-size: 0.78rem; color: var(--danger); margin-top: 2px; }

/* ═══════════ Cards / Surfaces ═══════════ */
.card {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-1);
}
.card--feature { padding: 28px; }
.card--feature h3 { margin-bottom: 10px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-elev-2);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.badge--brand { background: color-mix(in oklab, var(--brand) 12%, transparent); color: var(--brand); }
.badge--success { background: color-mix(in oklab, var(--success) 12%, transparent); color: var(--success); }
.badge--danger { background: color-mix(in oklab, var(--danger) 12%, transparent); color: var(--danger); }
.badge--warning { background: color-mix(in oklab, var(--warning) 14%, transparent); color: #a16207; }

/* ═══════════ Topbar / Public Nav ═══════════ */
.pub-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  max-width: 1200px; margin: 0 auto;
}
.pub-nav__brand { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; color: var(--text); }
.pub-nav__brand span { color: var(--brand); }
.pub-nav__links { display: flex; gap: 24px; align-items: center; }
.pub-nav__links a { color: var(--text-muted); font-weight: 500; }
.pub-nav__links a:hover { color: var(--text); text-decoration: none; }

/* ═══════════ Hero ═══════════ */
.hero {
  padding: 100px 0 80px;
  text-align: center;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); max-width: 820px; margin: 0 auto 20px; }
.hero__sub { font-size: 1.15rem; color: var(--text-muted); max-width: 620px; margin: 0 auto 32px; }
.hero__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero__gradient {
  background: radial-gradient(ellipse 80% 50% at 50% -10%,
    color-mix(in oklab, var(--brand) 14%, transparent) 0%,
    transparent 50%);
}

/* ═══════════ Pricing Cards ═══════════ */
.plan {
  position: relative;       /* notwendig damit absolute "Beliebt"-Badge im Card-Kontext bleibt */
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: transform 200ms var(--ease-smooth), box-shadow 200ms;
}
.plan:hover { transform: translateY(-3px); box-shadow: var(--shadow-3); }
.plan--featured { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in oklab, var(--brand) 20%, transparent); }
.plan__name { font-size: 0.95rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }
.plan__price { font-size: 2.6rem; font-weight: 800; color: var(--text); letter-spacing: -0.03em; }
.plan__price-unit { font-size: 0.95rem; color: var(--text-faint); font-weight: 500; }
.plan__list { list-style: none; margin-top: 24px; }
.plan__list li { padding: 8px 0; color: var(--text-muted); font-size: 0.92rem; display: flex; align-items: center; gap: 10px; }
.plan__list li::before {
  content: '';
  width: 16px; height: 16px;
  background: var(--brand);
  border-radius: 50%;
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  mask-size: 12px; mask-repeat: no-repeat; mask-position: center;
  flex-shrink: 0;
}

/* ═══════════ Tenant-App Layout ═══════════ */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.side {
  background: var(--bg-elev-1);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.side__brand {
  padding: 8px 12px 24px;
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.side__brand-logo {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--brand);
  color: var(--brand-on-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}
.side__item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem; font-weight: 500;
  transition: all 140ms;
}
.side__item:hover { background: var(--bg-elev-2); color: var(--text); text-decoration: none; }
.side__item--active {
  background: color-mix(in oklab, var(--brand) 10%, transparent);
  color: var(--brand);
  font-weight: 600;
}
.side__item svg { width: 16px; height: 16px; }

.app__main { padding: 32px 40px; overflow-y: auto; }
.app__topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 40px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev-1);
}

/* ═══════════ Auth-Pages (Login, Signup) ═══════════ */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth__right { display: none; } }

.auth__form {
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
}
.auth__card {
  width: 100%; max-width: 420px;
}
.auth__card h1 { font-size: 1.6rem; margin-bottom: 8px; }
.auth__card p  { margin-bottom: 28px; }

.auth__right {
  background: linear-gradient(135deg, var(--brand) 0%, color-mix(in oklab, var(--brand) 70%, #000) 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  color: var(--brand-on-primary);
}
.auth__right-card {
  max-width: 420px;
  text-align: center;
}
.auth__right-card h2 { color: inherit; font-size: 1.7rem; margin-bottom: 12px; }
.auth__right-card p  { color: color-mix(in oklab, white 85%, transparent); }

/* ═══════════ Tables ═══════════ */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.tbl th { background: var(--bg-elev-2); font-weight: 600; color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.tbl tr:hover td { background: var(--bg-elev-2); }

/* ═══════════ Alerts ═══════════ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 16px;
}
.alert--error { background: color-mix(in oklab, var(--danger) 10%, transparent); color: #991b1b; border: 1px solid color-mix(in oklab, var(--danger) 30%, transparent); }
.alert--success { background: color-mix(in oklab, var(--success) 12%, transparent); color: #065f46; border: 1px solid color-mix(in oklab, var(--success) 30%, transparent); }
.alert--info { background: color-mix(in oklab, var(--info) 10%, transparent); color: #0c4a6e; border: 1px solid color-mix(in oklab, var(--info) 30%, transparent); }

/* ═══════════ Animations ═══════════ */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeInUp 400ms var(--ease-smooth) both; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
