/* eightlayer — Freundebuch UI (mobile-first, calm future) */

:root{
  /* Colors */
  --bg: #0b0f14;
  --surface: rgba(17, 24, 38, 0.72);
  --surface-solid: #111826;
  --text: #e6edf3;
  --muted: #9aa4b2;
  --line: rgba(255,255,255,0.10);
  --line-strong: rgba(255,255,255,0.16);

  /* Accent (pink-ish, modern) */
  --accent: #ff2d55;
  --accent-soft: rgba(255, 45, 85, 0.18);
  --accent-glow: rgba(255, 45, 85, 0.35);

  /* Layout */
  --radius: 18px;
  --radius-lg: 22px;
  --pad: 18px;

  /* Effects */
  --shadow: 0 18px 60px rgba(0,0,0,0.45);
  --shadow-soft: 0 10px 30px rgba(0,0,0,0.30);
}

/* Reset / base */
*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  color: var(--text);
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  background: var(--bg); /* nur solide Farbe */
}

/* fixed background layer (prevents seams on long pages) */
html::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;

  background:
    radial-gradient(900px 520px at 18% 10%, var(--accent-soft), transparent 60%),
    radial-gradient(900px 520px at 82% 90%, rgba(0,200,255,0.12), transparent 55%),
    radial-gradient(700px 420px at 90% 12%, rgba(255,255,255,0.06), transparent 60%),
    var(--bg);
}

/* Subtle “layer lines” */
body::before{
  content:"";
  position:fixed;
  inset:0;
  background: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 100% 56px;
  opacity: 0.25;
  pointer-events:none;
  z-index: -2;

  /* statt radial mask: weich von oben nach unten */
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,.85) 40%, rgba(0,0,0,0) 100%);
}

/* Soft noise vibe (pure CSS, no image) */
body::after{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index: -1;
  background: repeating-linear-gradient(
    0deg,
    rgba(255,255,255,0.02),
    rgba(255,255,255,0.02) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.08;          /* weniger stark */
  /* mix-blend-mode: overlay;  <- raus damit */
}

a{ color: inherit; text-decoration: none; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible{
  outline: 3px solid rgba(255,45,85,0.35);
  outline-offset: 2px;
  border-radius: 12px;
}

/* Page container */
.wrap{
  width: min(920px, 100%);
  margin: 0 auto;
  /* mobile padding + notch safe-area */
  padding:
    22px
    max(14px, env(safe-area-inset-right))
    44px
    max(14px, env(safe-area-inset-left));
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

/* Header */
.header{
  padding-top: 8px;
}

.badge{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(10px);
}

.badge::before{
  content:"";
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: rgba(255,255,255,0.28);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.05);
}

h1{
  margin: 14px 0 6px;
  font-size: clamp(30px, 6.6vw, 54px);
  letter-spacing: -0.02em;
  line-height: 1.04;
}

.sub{
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.55;
  font-size: 16px;
}

/* Card / surface */
.card{
  padding: var(--pad);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), transparent 62%),
    var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.card h2{
  margin: 0 0 10px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.card p{
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

/* Divider line */
.hr{
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}

/* Actions / buttons */
.actions{
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.hint{
  color: var(--muted);
  font-size: 14px;
}

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px; /* mobile touch */
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid transparent;

  background: var(--accent);
  color: white;
  font-weight: 750;
  letter-spacing: 0.01em;
  cursor: pointer;
  user-select: none;

  box-shadow: 0 10px 30px rgba(255,45,85,0.22);
  transform: translateY(0);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease, border-color 160ms ease;
}

.btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 18px 50px rgba(255,45,85,0.28);
  filter: brightness(1.02);
}

.btn:active{
  transform: translateY(0);
  box-shadow: 0 10px 26px rgba(255,45,85,0.20);
}

.btn.ghost{
  background: rgba(255,255,255,0.03);
  border-color: var(--line);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.btn.ghost:hover{
  border-color: var(--line-strong);
  box-shadow: 0 14px 40px rgba(0,0,0,0.35);
}

.btn.full{
  width: 100%;
}

/* Form */
.form{
  margin-top: 10px;
}

.field{
  display: block;
  margin: 0 0 14px;
}

.field span{
  display: block;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 14px;
}

input, textarea, select{
  width: 100%;
  min-height: 46px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.26);
  color: var(--text);
  outline: none;

  /* iOS: verhindert Zoom beim Tippen */
  font-size: 16px;

  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

textarea{
  min-height: 140px;
  resize: vertical;
}

input::placeholder, textarea::placeholder{
  color: rgba(154,164,178,0.65);
}

input:focus, textarea:focus, select:focus{
  border-color: rgba(255,45,85,0.55);
  box-shadow: 0 0 0 4px rgba(255,45,85,0.16);
  background: rgba(0,0,0,0.30);
}

/* Small helper text under fields */
.help{
  margin-top: 6px;
  color: rgba(154,164,178,0.78);
  font-size: 12px;
  line-height: 1.35;
}

/* Footer */
.footer{
  margin-top: auto;
  padding-top: 10px;
  color: rgba(255,255,255,0.35);
  font-size: 12px;
  letter-spacing: 0.12em;
}

/* Nice “chip” list (optional) */
.chips{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:12px;
}
.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:9px 12px;
  border:1px solid var(--line);
  border-radius:999px;
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  font-size:14px;
}

/* Desktop spacing */
@media (min-width: 760px){
  .wrap{
    padding:
      46px
      max(18px, env(safe-area-inset-right))
      64px
      max(18px, env(safe-area-inset-left));
    gap: 18px;
  }
  .card{ padding: 22px; }
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce){
  .btn{ transition: none; }
  body::after{ display:none; }
}

/* ---------- page transitions ---------- */

body{
  opacity:0;
  transform: translateY(8px);
  animation: pageIn .45s ease forwards;
}

@keyframes pageIn{
  to{
    opacity:1;
    transform:translateY(0);
  }
}

body.fade-out{
  opacity:0;
  transform: translateY(-6px);
  transition: all .25s ease;
}

/* ---------- sticky mobile submit ---------- */

/* Counter */
.help{
  margin-top: 8px;
  color: rgba(154,164,178,0.78);
  font-size: 12px;
  line-height: 1.35;
}

/* Sticky submit (mobile) */
.sticky-submit{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px max(14px, env(safe-area-inset-right))
           calc(12px + env(safe-area-inset-bottom))
           max(14px, env(safe-area-inset-left));
  background: linear-gradient(to top, rgba(11,15,20,0.95), rgba(11,15,20,0.75), transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  z-index: 50;
}
.form{ padding-bottom: 120px; }

@media (min-width: 760px){
  .sticky-submit{ display:none; }
}

/* premium glow button */
.btn{
  position: relative;
  overflow: hidden;
}

.btn::after{
  content:"";
  position:absolute;
  inset:-2px;
  background: radial-gradient(240px 140px at var(--x, 50%) var(--y, 50%), rgba(255,255,255,0.22), transparent 60%);
  opacity: 0;
  transition: opacity 160ms ease;
  pointer-events:none;
}

.btn:hover::after{ opacity: 1; }
.btn:active::after{ opacity: .7; }

.card{
  position: relative;
  overflow: hidden;
}

.card::after{
  content:"";
  position:absolute;
  inset:-1px;
  background: radial-gradient(520px 220px at 20% 0%, rgba(255,255,255,0.08), transparent 55%);
  opacity: 0.55;
  pointer-events:none;
}

/* ---------- wizard ui ---------- */

.wizard-top{ margin-top: 14px; display:flex; flex-direction:column; gap:10px; }

.progress{
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  overflow: hidden;
}
.progress-bar{
  height:100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), rgba(0,200,255,0.55));
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(255,45,85,0.18);
  transition: width 220ms ease;
}

.wizard-meta{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }

.step{ display:none; animation: stepIn .35s ease both; }
.step.is-active{ display:block; }
@keyframes stepIn{ from{ opacity:0; transform: translateY(10px);} to{ opacity:1; transform: translateY(0);} }

.step-head{ margin-bottom: 10px; }
.step-sub{ margin: 0; color: var(--muted); line-height: 1.55; }

.grid3{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 760px){
  .grid3{ grid-template-columns: repeat(3, 1fr); }
}

/* Wizard nav */
.wizard-nav{
  margin-top: 18px;
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:flex-end;
}

.wizard-sticky{
  position: fixed;
  left:0; right:0; bottom:0;
  padding: 12px max(14px, env(safe-area-inset-right))
           calc(12px + env(safe-area-inset-bottom))
           max(14px, env(safe-area-inset-left));
  background: linear-gradient(to top, rgba(11,15,20,0.95), rgba(11,15,20,0.75), transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display:flex;
  gap:10px;
  z-index: 50;
}

.wizard-sticky .btn{ flex: 1; }
.form{ padding-bottom: 120px; }

/* Desktop: sticky aus, nav an */
@media (min-width: 760px){
  .wizard-sticky{ display:none; }
}
@media (max-width: 759px){
  .wizard-nav{ display:none; }
}

/* choices */
.choice-block{
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.03);
  margin-bottom: 12px;
}
.choice-title{
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 10px;
}
.choice-row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.choice{
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.22);
  color: var(--text);
  font-weight: 700;
  cursor:pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.choice:hover{ transform: translateY(-1px); border-color: rgba(255,255,255,0.18); }
.choice.is-selected{
  border-color: rgba(255,45,85,0.55);
  box-shadow: 0 0 0 4px rgba(255,45,85,0.16);
  background: rgba(255,45,85,0.10);
}

/* bonus list */
.bonus-list{ margin-top: 14px; display:flex; flex-direction:column; gap: 12px; }
.bonus-q{
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0,0,0,0.18);
}
.bonus-q .q{
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 8px;
}

/* accordion */
.accordion{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.03);
  padding: 12px;
  margin-bottom: 14px;
}
.accordion summary{
  cursor:pointer;
  font-weight: 750;
  list-style:none;
}
.accordion summary::-webkit-details-marker{ display:none; }
.accordion-body{ margin-top: 12px; }

/* --- Autosave Indicator --- */
.save-indicator{
  margin-top: 10px;
  min-height: 18px;
  font-size: 12px;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity .2s ease, transform .2s ease;
}
.save-indicator.is-on{
  opacity: 1;
  transform: translateY(0);
}

/* --- Disabled buttons visual --- */
.btn:disabled{
  opacity: .6;
  cursor: not-allowed;
  filter: grayscale(.1);
}