:root{
  --bg:#0B1220;
  --card:#0F1A2E;
  --text:#EAF0FF;
  --muted:#A7B3CE;
  --line: rgba(255,255,255,.12);
  --line2: rgba(255,255,255,.18);
  --accent:#3B82F6;
  --good:#22C55E;
  --bad:#EF4444;
  --shadow: 0 18px 60px rgba(0,0,0,.40);
  --radius: 18px;

  /* sorgt auf iOS für konsistenteres native rendering */
  color-scheme: dark;
}

*{ box-sizing:border-box; }
html{ height:auto; }
body{
  margin:0;
  min-height:100vh; /* statt height:100% -> iOS weniger Artefakte */
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: var(--text);

  /* Background bleibt, aber iOS-freundlicher */
  background:
    radial-gradient(900px 700px at 15% -10%, rgba(59,130,246,.28), transparent 60%),
    radial-gradient(800px 650px at 110% 10%, rgba(34,197,94,.14), transparent 55%),
    radial-gradient(800px 650px at 40% 120%, rgba(239,68,68,.10), transparent 55%),
    var(--bg);

  /* verhindert teilweise komische iOS layer-mischungen */
  overflow-x:hidden;
}

/* ===== Topbar (no blur – kills iOS “blue veil”) ===== */
.topbar{
  position: sticky;
  top: 0;
  z-index: 30;

  /* blur ist DER #1 bugtrigger */
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;

  background: rgba(11,18,32,.96);
  border-bottom: 1px solid var(--line);
}

.topbar-inner{
  max-width: 980px;
  margin: 0 auto;

  /* safe-area oben */
  padding:
    calc(10px + env(safe-area-inset-top, 0px))
    14px
    10px;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}

.brand{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width: 0;
}

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

.logo{
  height: 30px;
  width: auto;
  display:block;
  border-radius: 8px;
}

.brand-text{
  display:flex;
  flex-direction:column;
  gap: 2px;
  min-width: 0;
}

.brand-title{
  font-weight: 800;
  letter-spacing: .2px;
  font-size: 13px;
  white-space: nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.brand-sub{
  font-size: 12px;
  color: var(--muted);
}

.adminlink{
  color: var(--muted);
  text-decoration:none;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.adminlink:hover{ border-color: var(--line2); color: var(--text); }

/* ===== Layout ===== */
.shell{
  max-width: 980px;
  margin: 0 auto;

  /* safe-area unten -> verhindert “footer overlay feeling” */
  padding: 16px 14px calc(56px + env(safe-area-inset-bottom, 0px));
}

/* Card: auf iOS weniger “glasig” + weniger heavy shadow */
.card{
  background: rgba(15,26,46,.92); /* stabil statt sehr transparent */
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow:hidden;
  box-shadow: var(--shadow);
}

/* iOS: Schatten kann artefakte triggern -> etwas reduzieren */
@supports (-webkit-touch-callout: none) {
  .card{ box-shadow: 0 10px 30px rgba(0,0,0,.30); }
}

.card-head{ padding: 18px 16px 8px; }

h1{
  margin:0 0 8px;
  font-size: 22px;
  letter-spacing: .2px;
}
h2{ margin: 0 0 10px; font-size: 18px; }

.muted{ color: var(--muted); }
.small{ font-size: 12px; }
.center{ text-align:center; }

/* ===== Progress ===== */
.progress{ padding: 10px 16px 16px; }
.progressbar{
  width:100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.10);
}
.progressbar-fill{
  height:100%;
  background: linear-gradient(90deg, rgba(59,130,246,1), rgba(34,197,94,1));
  width:0%;
  transition: width .25s ease;
}
.progressmeta{
  margin-top: 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}

.step{ padding: 14px 16px 18px; }
.hidden{ display:none !important; }

/* ===== Buttons ===== */
.actions{
  display:flex;
  gap: 10px;
  margin-top: 14px;
}
.btn{
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 800;
  cursor:pointer;
  width: 100%;
}
.btn:hover{ border-color: var(--line2); }
.btn:disabled{ opacity:.6; cursor:not-allowed; }

.btn-primary{
  background: linear-gradient(180deg, rgba(59,130,246,1), rgba(37,99,235,1));
  border-color: rgba(59,130,246,.45);
}
.btn-secondary{ background: rgba(255,255,255,.05); }

/* ===== Count ===== */
.countrow{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-top: 10px;
}
.countbox{
  flex:1;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 12px;
  text-align:center;
}
.count{ font-size: 28px; font-weight: 900; }

/* ===== Fields ===== */
.field{
  display:flex;
  flex-direction:column;
  gap: 8px;
  margin-top: 12px;
}

label{
  font-size: 12px;
  font-weight: 800;
  color: rgba(234,240,255,.92);
  letter-spacing: .2px;
}
.hint{
  font-size: 12px;
  color: var(--muted);
  margin-top: -2px;
}

/* ===== Inputs ===== */
.input{
  width:100%;
  max-width:100%;
  display:block;

  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(8,14,26,.55);
  color: var(--text);
  outline: none;

  font-size: 16px; /* iOS zoom prevention */
  line-height: 1.2;
}

.input::placeholder{ color: rgba(167,179,206,.75); }
.input:focus{
  border-color: rgba(59,130,246,.75);
  box-shadow: 0 0 0 4px rgba(59,130,246,.18);
}

/* Date input iOS fix: gleiche Höhe + kein “ausbrechen” */
input[type="date"].input{
  -webkit-appearance: none;
  appearance: none;

  height: 52px;
  min-height: 52px;

  padding: 14px 14px;
  line-height: 1.2;
  box-sizing: border-box;
}

/* iOS: Value-Rendering normalisieren */
input[type="date"].input::-webkit-date-and-time-value{
  padding: 0;
  margin: 0;
  text-align: left;
  line-height: 1.2;
}

/* ===== Upload UI ===== */
.grid2{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}
@media (min-width: 760px){
  .grid2{ grid-template-columns: 1fr 1fr; }
}

.uploader{
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
}
.uhead{ margin-bottom: 10px; }
.utitle{ font-weight: 900; }
.usub{ font-size: 12px; }

.filebtn{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.16);
  cursor:pointer;
  font-weight: 800;
}
.filebtn:hover{ border-color: rgba(255,255,255,.22); }
.filebtn input{ display:none; }

.thumb{
  margin-top: 10px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,.22);
  background: rgba(8,14,26,.45);
  min-height: 140px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  position: relative;
}
.thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:none;
}
.thumb-empty{ padding: 10px; }

/* ===== Notes / Pills ===== */
.note{
  margin-top: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(59,130,246,.08);
  padding: 12px;
}
.note-title{ font-weight: 900; }
.note-text{ margin-top: 4px; font-size: 13px; color: rgba(234,240,255,.92); }

.review{
  margin-top: 12px;
  display:flex;
  flex-direction:column;
  gap: 10px;
}
.review-row{
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  border-radius: 16px;
  padding: 12px;
  display:grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.review-title{ font-weight: 900; }
.review-files{ display:flex; gap: 8px; flex-wrap:wrap; }

.pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 900;
  font-size: 12px;
  background: rgba(255,255,255,.05);
}
.pill.ok{ border-color: rgba(34,197,94,.35); }
.pill.bad{ border-color: rgba(239,68,68,.35); }

.submitStatus{
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,.04);
  font-weight: 800;
}

.footer{
  margin-top: 16px;
  text-align:center;
}
