:root {
  --bg-deep: #14110F;
  --bg-panel: #1E1A16;
  --bg-card: #241F1A;
  --gold: #C9A660;
  --gold-light: #F0DFAF;
  --gold-dim: #7A6538;
  --cream: #F3ECDD;
  --cream-dim: #B7AD9B;
  --rose: #B87C6C;
  --line: rgba(201, 166, 96, 0.22);
  --font-display: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-deep);
  color: var(--cream);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

.screen {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  transition: opacity 0.5s ease;
}

.hidden {
  display: none !important;
}

/* ============== SPLASH ============== */
.splash {
  background: radial-gradient(ellipse at 50% 40%, #201B15 0%, var(--bg-deep) 70%);
}

.rings-wrap {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rings-svg {
  position: absolute;
  width: 62%;
  height: 62%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.ring {
  fill: none;
  stroke: var(--gold);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 327; /* ~2*pi*52 */
  stroke-dashoffset: 327;
  filter: drop-shadow(0 0 6px rgba(201, 166, 96, 0.45));
}

.ring-a { animation: draw-ring 1.4s ease-out forwards; }
.ring-b { animation: draw-ring 1.4s ease-out 0.35s forwards; }

@keyframes draw-ring {
  to { stroke-dashoffset: 0; }
}

.progress-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-ring__bg,
.progress-ring__fill {
  fill: none;
  stroke-width: 2.5;
}

.progress-ring__bg {
  stroke: var(--line);
}

.progress-ring__fill {
  stroke: var(--gold-light);
  stroke-linecap: round;
  stroke-dasharray: 678.6; /* 2*pi*108 */
  stroke-dashoffset: 678.6;
  transition: stroke-dashoffset 0.15s linear;
}

.splash-word {
  margin-top: 28px;
  font-family: var(--font-display);
  font-size: 2.1rem;
  letter-spacing: 0.12em;
  color: var(--gold-light);
  font-weight: 500;
}

.splash-sub {
  margin-top: 4px;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  color: var(--cream-dim);
}

/* ============== LOGIN ============== */
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 40px 32px 32px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.login-mark svg {
  width: 84px;
  height: 56px;
  stroke: var(--gold);
  stroke-width: 3;
  fill: none;
}

.login-title {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 14px 0 2px;
  color: var(--gold-light);
  letter-spacing: 0.06em;
}

.login-tagline {
  margin: 0 0 24px;
  color: var(--cream-dim);
  font-size: 0.85rem;
}

.field {
  display: block;
  text-align: left;
  margin-bottom: 18px;
}

.field-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream-dim);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--cream);
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 166, 96, 0.18);
}

.field-error {
  min-height: 18px;
  color: var(--rose);
  font-size: 0.82rem;
  margin: -6px 0 12px;
  text-align: left;
}

.btn-gold {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #201A10;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-gold:hover { box-shadow: 0 8px 24px rgba(201,166,96,0.3); }
.btn-gold:active { transform: scale(0.98); }

.shake { animation: shake 0.4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* ============== MAIN ============== */
.main {
  position: relative;
  justify-content: flex-start;
  padding-top: 48px;
  max-width: 720px;
  margin: 0 auto;
}

.main-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-rings {
  position: absolute;
  width: 640px;
  height: 420px;
  top: -80px;
  right: -160px;
  opacity: 0.06;
}

.bg-rings circle {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
}

.main-header {
  width: 100%;
  text-align: left;
  margin-bottom: 36px;
}

.main-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--cream-dim);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold-light);
}

.main-title {
  font-family: var(--font-display);
  font-size: 2.6rem;
  margin: 0;
  color: var(--gold-light);
  letter-spacing: 0.03em;
}

.main-subtitle {
  margin: 4px 0 0;
  color: var(--cream-dim);
  font-size: 0.95rem;
}

.card-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (min-width: 560px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 16px;
  text-align: left;
  cursor: pointer;
  color: var(--cream);
  font-family: var(--font-body);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 128px;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: 0 12px 28px rgba(0,0,0,0.35);
}

.card:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.card-icon {
  width: 30px;
  height: 20px;
}

.card-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--gold);
  stroke-width: 5;
}

.card-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--gold-light);
}

/* ============== DETAIL PLACEHOLDER ============== */
.detail {
  align-items: flex-start;
  max-width: 720px;
  margin: 0 auto;
}

.back-btn {
  margin-bottom: 28px;
}

.detail-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold-light);
  margin: 0 0 8px;
}

.detail-body {
  color: var(--cream-dim);
}

.detail-content {
  width: 100%;
}

/* --- PDF viewer --- */
.pdf-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.pdf-toolbar a {
  text-decoration: none;
}

.pdf-frame {
  width: 100%;
  height: 72vh;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0d0b09;
}

.pdf-missing {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 28px;
  color: var(--cream-dim);
  font-size: 0.9rem;
  line-height: 1.6;
}

.pdf-missing code {
  color: var(--gold-light);
  background: var(--bg-panel);
  padding: 2px 6px;
  border-radius: 4px;
}

/* --- Calculator placeholder --- */
.calc-notice {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 24px;
  color: var(--cream-dim);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ============== KRANKMELDUNG WIZARD PAGE ============== */
.wizard-card {
  max-width: 440px;
  text-align: left;
}

.wizard-card .login-title,
.wizard-card .login-tagline {
  text-align: center;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  text-decoration: none;
}

.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--cream);
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 166, 96, 0.18);
}

.field textarea {
  resize: vertical;
}

.sub-date {
  margin-top: 8px;
}

.date-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-row input {
  flex: 1;
}

.date-sep {
  color: var(--cream-dim);
  font-size: 0.85rem;
}

.hint {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--cream-dim);
  line-height: 1.5;
}

.field-label em {
  color: var(--rose);
  font-style: normal;
  font-size: 0.75rem;
}

.sent-state {
  text-align: center;
  padding-top: 6px;
}

.sent-text {
  color: var(--cream-dim);
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0 0 20px;
}

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