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

:root {
  --bg:           #f4f4f6;
  --surface:      #ffffff;
  --surface2:     #f9f9fb;
  --border:       #e2e2e7;
  --border-focus: #e8a020;
  --text:         #111111;
  --text-muted:   #6b6b6b;
  --accent:       #c51a1b;
  --accent-glow:  rgba(197, 26, 27, 0.18);
  --accent-dark:  #9e1516;
  --input-bg:     #ffffff;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.05);
  --shadow-md:    0 2px 6px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.07);
}

body {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Header (dunkel für Marken-Kontrast) ──────────────────── */
header {
  background: #000000;
  border-bottom: 1px solid #1a1a1a;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-logo {
  height: 38px;
  width: auto;
  display: block;
}

.header-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.2);
}

.header-title {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
}

/* ── Login Screen ─────────────────────────────────────────── */
.login-screen {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-card-logo {
  background: #000;
  margin: -2.5rem -2rem 1.75rem;
  padding: 1.25rem 2rem;
  border-radius: 16px 16px 0 0;
  display: flex;
  justify-content: center;
}

.login-logo {
  height: 34px;
  width: auto;
}

.login-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.login-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.login-card .field { text-align: left; }

/* ── Header Dealer ────────────────────────────────────────── */
.header-dealer {
  display: none;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.header-dealer-name {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.55);
  font-weight: 500;
}

.btn-logout {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.55);
  padding: 0.3rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  cursor: pointer;
  border-radius: 5px;
  transition: border-color 0.15s, color 0.15s;
}

.btn-logout:hover {
  border-color: rgba(255,255,255,0.5);
  color: rgba(255,255,255,0.85);
}

/* ── Stepper ──────────────────────────────────────────────── */
.stepper-wrap {
  position: sticky;
  top: 0;
  z-index: 9;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
}

.stepper {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.step-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  transition: background 0.35s;
}

.step-connector.completed { background: var(--accent); }

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: default;
}

.step-bubble {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #999;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
  position: relative;
}

.step-num  { transition: opacity 0.2s; }
.step-check {
  position: absolute;
  width: 14px;
  height: 14px;
  opacity: 0;
  transition: opacity 0.2s;
}

.step-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #aaa;
  transition: color 0.3s;
  white-space: nowrap;
}

/* Active step */
.step-item.active .step-bubble {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(197,26,27,0.15);
}
.step-item.active .step-label { color: var(--accent); }

/* Completed step */
.step-item.completed .step-bubble {
  background: var(--accent);
  border-color: var(--accent);
}
.step-item.completed .step-num  { opacity: 0; }
.step-item.completed .step-check { opacity: 1; }
.step-item.completed .step-label { color: var(--accent); }

/* ── Form Steps ───────────────────────────────────────────── */
.form-step { display: none; }
.form-step.active { display: block; }

.step-heading {
  margin-bottom: 1.75rem;
}

.step-heading-num {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.step-heading-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.step-heading-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Navigation ───────────────────────────────────────────── */
.form-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.75rem;
  gap: 1rem;
}

.btn-back {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.8rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  border-radius: 8px;
  transition: border-color 0.15s, color 0.15s;
}

.btn-back:hover {
  border-color: #aaa;
  color: var(--text);
}

/* ── Main ─────────────────────────────────────────────────── */
main {
  max-width: 900px;
  margin: 2.5rem auto;
  padding: 0 1.5rem 5rem;
}

.page-title {
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
  color: var(--text);
}

/* ── Sections ─────────────────────────────────────────────── */
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  transition: box-shadow 0.2s;
}

.section:focus-within {
  box-shadow: var(--shadow-md);
}

.section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  padding-left: 0.8rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0.75rem;
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ── Grid ─────────────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.25rem;
}

.col-span-2 { grid-column: span 2; }

/* ── Fields & Labels ──────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 0.375rem; }

label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

label .required { color: #d03030; margin-left: 2px; }

/* ── Inputs ───────────────────────────────────────────────── */
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"],
input[type="number"],
textarea {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  padding: 0.65rem 0.9rem;
  font-size: 0.875rem;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:hover, textarea:hover {
  border-color: #c4c4cc;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder, textarea::placeholder {
  color: #b8b8c0;
}

textarea {
  resize: vertical;
  min-height: 80px;
  background: var(--surface2);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.5;
  cursor: pointer;
}

/* ── Radio ────────────────────────────────────────────────── */
.radio-group {
  display: flex;
  gap: 2rem;
  padding: 0.5rem 0;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text);
}

.radio-option input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ── Stempel ──────────────────────────────────────────────── */
.stempel-area { min-height: 120px; }

/* ── Submit / Next ────────────────────────────────────────── */
.btn-next,
.btn-submit {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.875rem 2.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  border-radius: 8px;
  box-shadow: 0 3px 16px rgba(197, 26, 27, 0.3);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.btn-next:hover,
.btn-submit:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(197, 26, 27, 0.4);
}

.btn-next:active,
.btn-submit:active { transform: translateY(0); }

.btn-next:disabled,
.btn-submit:disabled {
  background: #e0e0e4;
  color: #aaa;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* ── Messages ─────────────────────────────────────────────── */
.msg { font-size: 0.8rem; }
.msg-error { color: #c82020; }

.field-error {
  font-size: 0.75rem;
  color: #c82020;
  min-height: 1rem;
}

.input-error {
  border-color: #c82020 !important;
  box-shadow: 0 0 0 3px rgba(200, 32, 32, 0.15) !important;
}

/* ── Success ──────────────────────────────────────────────── */
.success-box {
  display: none;
  background: #f0faf0;
  border: 1px solid #b8ddb8;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 3.5rem 2rem;
  text-align: center;
  margin-top: 2rem;
}

.success-icon {
  width: 56px;
  height: 56px;
  background: #2e9e4f;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 1.25rem;
}

.success-box h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.success-box p { color: var(--text-muted); font-size: 0.875rem; }

.success-id {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: monospace;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-dark);
  background: rgba(197, 26, 27, 0.08);
  border: 1px solid rgba(197, 26, 27, 0.25);
  border-radius: 6px;
  padding: 0.3rem 0.9rem;
}

/* ── Hamburger ────────────────────────────────────────────── */
.btn-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 6px;
  transition: background 0.15s;
}
.btn-hamburger:hover { background: rgba(255,255,255,0.1); }
.btn-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: rgba(255,255,255,0.65);
  border-radius: 2px;
  transition: background 0.15s;
}
.btn-hamburger:hover span { background: #fff; }

/* ── Menu Drawer ──────────────────────────────────────────── */
.menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99;
  animation: fadeIn 0.2s ease;
}
.menu-overlay.open { display: block; }

.menu-drawer {
  position: fixed;
  top: 0;
  left: -300px;
  width: 280px;
  height: 100vh;
  background: var(--surface);
  box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  z-index: 100;
  transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.menu-drawer.open { left: 0; }

.menu-header {
  background: #000;
  padding: 1.25rem 1.25rem 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.menu-dealer-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}
.menu-close:hover { color: #fff; }

.menu-nav {
  list-style: none;
  padding: 1rem 0;
  flex: 1;
}
.menu-nav-item {
  width: 100%;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.menu-nav-item:hover {
  background: var(--bg);
  color: var(--accent);
}
.menu-nav-item svg { opacity: 0.55; flex-shrink: 0; }
.menu-nav-item:hover svg { opacity: 1; }

/* ── View Header ──────────────────────────────────────────── */
.view-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}
.view-title {
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
}

/* ── Warranty Cards ───────────────────────────────────────── */
.warranty-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.warranty-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #d0d0d8;
}

.warranty-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.75rem;
}
.warranty-id {
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.warranty-card-mid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem 1.5rem;
  margin-bottom: 1rem;
}
.warranty-field { display: flex; flex-direction: column; gap: 0.1rem; }
.wf-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.warranty-card-bot {
  border-top: 1px solid var(--border);
  padding-top: 0.875rem;
  display: flex;
  justify-content: flex-end;
}
.btn-detail {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: opacity 0.15s;
}
.btn-detail:hover { opacity: 0.75; }

/* ── Status Badges ────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}
.status-eingereicht    { background: #f3f4f6; color: #6b7280; }
.status-in_bearbeitung { background: #fef3c7; color: #d97706; }
.status-genehmigt      { background: #d1fae5; color: #059669; }
.status-abgelehnt      { background: #fee2e2; color: #dc2626; }

/* ── Detail View ──────────────────────────────────────────── */
.detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.detail-id {
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.detail-date { font-size: 0.8rem; color: var(--text-muted); }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 2rem;
}
.detail-grid--full { grid-template-columns: 1fr; }

.detail-field { display: flex; flex-direction: column; gap: 0.2rem; }
.detail-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.detail-value {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.5;
}

/* ── Loading / Empty ──────────────────────────────────────── */
.loading-text, .empty-text {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 1rem;
  font-size: 0.9rem;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Responsive ───────────────────────────────────────────── */

/* Tablet */
@media (max-width: 780px) {
  .header-title { display: none; }
  .header-divider { display: none; }
}

/* Mobile */
@media (max-width: 680px) {
  .warranty-card-mid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  /* Header */
  header {
    padding: 0.875rem 1rem;
    gap: 0.75rem;
    flex-wrap: nowrap;
  }
  .header-logo { height: 28px; }
  .header-dealer { gap: 0.5rem; }
  .header-dealer-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.68rem;
  }

  /* Stepper */
  .stepper-wrap { padding: 0.75rem 1rem; }
  .step-label { display: none; }
  .step-bubble { width: 30px; height: 30px; font-size: 0.75rem; }
  .step-check { width: 12px; height: 12px; }

  /* Layout */
  main { padding: 0 1rem 3rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }

  /* Radio */
  .radio-group { gap: 1rem; flex-wrap: wrap; }

  /* Nav buttons */
  .form-nav { flex-wrap: wrap; }
  .btn-back, .btn-next, .btn-submit { padding: 0.8rem 1.25rem; }
  .btn-next, .btn-submit { flex: 1; }

  /* Login */
  .login-card { border-radius: 12px; }
  .login-card-logo { border-radius: 12px 12px 0 0; }

  /* Step heading */
  .step-heading-title { font-size: 1.15rem; }
}
