:root {
  --black: #050506;
  --black-soft: #0b0b0e;
  --panel: rgba(18, 17, 21, .94);
  --panel-2: #121116;
  --line: rgba(255, 255, 255, .10);
  --red: #e0002a;
  --red-dark: #730016;
  --red-glow: rgba(224, 0, 42, .33);
  --text: #f6f3f4;
  --muted: #9f969b;
  --countdown-progress: 1;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; min-height: 100vh; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--black); color: var(--text); }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }

.portal-body {
  min-height: 100svh;
  background:
    radial-gradient(circle at 15% 20%, rgba(224,0,42,.13), transparent 27%),
    radial-gradient(circle at 85% 76%, rgba(119,0,23,.18), transparent 30%),
    linear-gradient(135deg, #020203 0%, #0b090c 55%, #030304 100%);
  overflow-x: hidden;
}

.portal-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 92%);
}

.login-shell, .content-shell, .countdown-shell {
  min-height: 100svh;
  width: min(100% - 32px, 1160px);
  margin: auto;
  display: grid;
  place-items: center;
  padding: 48px 0;
  position: relative;
}

.login-card, .content-card {
  width: min(100%, 520px);
  position: relative;
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(27,24,29,.97), rgba(8,8,10,.97));
  box-shadow: 0 30px 100px rgba(0,0,0,.55), 0 0 70px rgba(224,0,42,.07);
  overflow: hidden;
}

.login-card::after, .content-card::after {
  content: "";
  position: absolute;
  right: -105px;
  top: -105px;
  width: 240px;
  height: 240px;
  border: 32px solid rgba(224,0,42,.13);
  transform: rotate(45deg);
  pointer-events: none;
}

.sigil {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(224,0,42,.45);
  background: #0a090b;
  transform: rotate(45deg);
  margin: 0 0 42px 8px;
  box-shadow: 0 0 34px var(--red-glow);
}
.sigil span { width: 22px; height: 22px; border: 4px solid var(--red); }

.kicker { margin: 0 0 13px; color: var(--red); text-transform: uppercase; letter-spacing: .22em; font-size: .73rem; font-weight: 900; }
h1 { margin: 0; font-size: clamp(2.35rem, 7vw, 4.5rem); line-height: .97; letter-spacing: -.055em; }
.lead { color: var(--muted); margin: 20px 0 30px; line-height: 1.65; }
.intro-copy { max-width: 760px; }

.portal-form { display: grid; gap: 17px; }
.portal-form label { display: grid; gap: 8px; }
.portal-form label > span:first-child { color: #d5cfd2; font-size: .82rem; font-weight: 800; letter-spacing: .04em; }
.portal-form input:not([type="checkbox"]) {
  width: 100%; min-height: 54px; border-radius: 13px; padding: 0 16px;
  border: 1px solid rgba(255,255,255,.13); background: #08080a; color: white; outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.portal-form input:not([type="checkbox"]):focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(224,0,42,.13); transform: translateY(-1px); }

.red-button, .ghost-button {
  min-height: 54px; display: inline-flex; align-items: center; justify-content: center; border-radius: 13px;
  padding: 0 22px; font-weight: 900; letter-spacing: .025em; cursor: pointer; transition: .2s ease;
}
.red-button { border: 1px solid #ff1a44; background: linear-gradient(135deg, #f30031, #a80021); color: white; box-shadow: 0 14px 34px rgba(224,0,42,.25); }
.red-button:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 18px 46px rgba(224,0,42,.36); }
.red-button:disabled { opacity: .55; cursor: wait; transform: none; }
.ghost-button { border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.035); color: white; }
.ghost-button:hover { border-color: rgba(255,255,255,.35); transform: translateY(-2px); }
.quiet-link { display: block; margin-top: 24px; color: var(--muted); text-align: center; font-size: .84rem; }
.quiet-link:hover { color: white; }

.alert { margin: 0 0 22px; padding: 14px 16px; border-radius: 12px; line-height: 1.45; font-size: .9rem; }
.alert-error { color: #ffdfe5; border: 1px solid rgba(255,35,75,.4); background: rgba(138,0,25,.28); }
.alert-warning { color: #f8d7dd; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.045); }

.portal-header {
  height: 76px; width: min(100% - 32px, 1160px); margin: auto; display: flex; align-items: center; justify-content: space-between;
  position: relative; z-index: 5; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .86rem;
}
.portal-brand { display: flex; align-items: center; gap: 12px; color: white; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.portal-brand i { width: 18px; height: 18px; display: block; background: var(--red); transform: rotate(45deg); box-shadow: 0 0 18px var(--red-glow); }
.portal-header a:hover { color: white; }

.form-page .content-shell { min-height: calc(100svh - 76px); padding-top: 38px; }
.wide-card { width: min(100%, 940px); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.consent-row { grid-template-columns: 22px 1fr; align-items: start; gap: 12px !important; padding: 14px 0; color: var(--muted); line-height: 1.5; }
.consent-row input { width: 18px; height: 18px; accent-color: var(--red); margin-top: 2px; }
.consent-row span { font-size: .86rem !important; font-weight: 500 !important; letter-spacing: 0 !important; }

.countdown-page {
  background:
    radial-gradient(circle at center, rgba(255,0,47,.32), transparent 28%),
    linear-gradient(120deg, #4a000e, #b00022 50%, #240007);
  animation: redPulse 3s ease-in-out infinite;
}
@keyframes redPulse { 50% { filter: saturate(1.18) brightness(1.08); } }
.countdown-page::before { opacity: .28; }
.countdown-card { text-align: center; position: relative; z-index: 2; }
.countdown-copy { max-width: 680px; margin: 0 auto 24px; color: #ffe4e9; line-height: 1.6; }
.countdown-number {
  width: min(72vw, 410px); aspect-ratio: 1; margin: 0 auto 20px; display: grid; place-items: center;
  border-radius: 50%; border: 2px solid rgba(255,255,255,.26); font-size: clamp(7rem, 27vw, 15rem); line-height: 1;
  font-weight: 950; letter-spacing: -.09em; text-shadow: 0 0 45px rgba(255,255,255,.2); position: relative;
  background: rgba(0,0,0,.18); box-shadow: inset 0 0 70px rgba(0,0,0,.35), 0 0 80px rgba(255,0,48,.35);
}
.countdown-number::before {
  content: ""; position: absolute; inset: -12px; border-radius: inherit;
  background: conic-gradient(#fff calc(var(--countdown-progress) * 1turn), rgba(255,255,255,.10) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 0);
}
.countdown-number.finished { animation: finishFlash .6s ease 2; }
@keyframes finishFlash { 50% { background: white; color: var(--red-dark); } }
.countdown-label { margin-bottom: 28px; text-transform: uppercase; letter-spacing: .2em; font-size: .75rem; font-weight: 900; }
.camera-release { width: min(100%, 330px); margin-inline: auto; }
.warning-lines { position: fixed; inset: 0; opacity: .08; background: repeating-linear-gradient(135deg, transparent 0 30px, #fff 30px 60px); }

.camera-shell { padding-block: 40px; }
.camera-card { width: min(100%, 900px); }
.camera-frame {
  min-height: min(62vh, 580px); display: grid; place-items: center; overflow: hidden; position: relative;
  border-radius: 22px; border: 1px solid rgba(255,255,255,.15); background: #020203; box-shadow: inset 0 0 70px rgba(0,0,0,.6);
}
.camera-frame video, .camera-frame img { width: 100%; height: 100%; max-height: 580px; object-fit: contain; background: black; }
.camera-placeholder { display: grid; place-items: center; gap: 18px; color: var(--muted); }
.lens { width: 96px; height: 96px; border-radius: 50%; border: 12px solid #252329; box-shadow: inset 0 0 0 10px #08080a, 0 0 0 1px rgba(255,255,255,.12), 0 0 45px var(--red-glow); position: relative; }
.lens::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; background: var(--red); top: 10px; right: 10px; }
.camera-status { margin: 0 0 15px; padding: 12px 14px; border-left: 3px solid var(--red); background: rgba(255,255,255,.035); color: #c8c0c4; font-size: .9rem; }
.camera-status.error-state { color: #ffdce3; background: rgba(224,0,42,.12); }
.camera-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.camera-actions button { flex: 1 1 180px; }

.success-screen {
  position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; text-align: center; padding: 24px;
  background: radial-gradient(circle, #4d0010, #0b0002 66%, #000); animation: successIn .45s ease both;
}
.success-screen h2 { margin: 25px 0 10px; font-size: clamp(2.3rem, 8vw, 5.3rem); letter-spacing: -.055em; }
.success-screen p { margin: 0; color: #e8cbd1; font-size: 1.15rem; }
.success-mark { width: 120px; height: 120px; display: grid; place-items: center; border-radius: 50%; margin: auto; border: 2px solid var(--red); color: white; font-size: 4rem; background: var(--red-dark); box-shadow: 0 0 80px var(--red-glow); }
@keyframes successIn { from { opacity: 0; transform: scale(1.04); } }

.is-hidden { display: none !important; }

@media (max-width: 720px) {
  .field-grid { grid-template-columns: 1fr; }
  .login-shell, .content-shell, .countdown-shell { width: min(100% - 20px, 1160px); }
  .login-card, .content-card { border-radius: 20px; padding: 26px 20px; }
  .portal-header { width: min(100% - 24px, 1160px); }
  .camera-frame { min-height: 430px; }
}

/* Sichtbarer 5-Sekunden-Fototimer ohne Video- oder Tonaufnahme */
.photo-countdown {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  background: radial-gradient(circle, rgba(126,0,22,.50), rgba(0,0,0,.74));
  backdrop-filter: blur(2px);
  text-align: center;
  pointer-events: none;
}

.photo-countdown span {
  width: clamp(138px, 34vw, 230px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.88);
  background: rgba(151,0,29,.78);
  color: #fff;
  font-size: clamp(5.5rem, 23vw, 11rem);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -.08em;
  box-shadow: 0 0 70px rgba(224,0,42,.65), inset 0 0 45px rgba(0,0,0,.30);
  animation: photoTimerPulse 1s ease-in-out infinite;
}

.photo-countdown small {
  color: #fff;
  font-size: clamp(.78rem, 3vw, 1rem);
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-shadow: 0 2px 10px #000;
}

@keyframes photoTimerPulse {
  50% { transform: scale(1.05); filter: brightness(1.18); }
}

@media (max-width: 720px) {
  .camera-card { padding-inline: 14px; }
  .camera-frame { min-height: min(64svh, 560px); }
  .camera-actions { position: sticky; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 12; }
  .camera-actions button { min-height: 58px; }
}
