/* ---- Base (Light theme, blue accents) ---- */
:root{
  --bg:#ffffff;
  --panel:#ffffff;
  --panel-2:#ffffff;
  --text:#0f172a;           /* slate-900 */
  --muted:#64748b;          /* slate-500 */
  --brand:#0d6efd;          /* bootstrap primary */
  --brand-hover:#0b5ed7;
  --danger:#dc3545;
  --ok:#198754;
  --border:#e5e7eb;         /* light gray */
  --shadow:0 10px 24px rgba(0,0,0,.06);
  --radius:12px;
  --radius-sm:8px;
  --pad:18px;
  --pad-sm:12px;
  --maxw:1200px;
  --focus:0 0 0 3px rgba(13,110,253,.25);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font:14px/1.5 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,"Helvetica Neue",Arial,"Noto Sans",sans-serif;
}

/* ---- Layout ---- */
.container{
  width:100%;
  max-width:var(--maxw);
  margin:0 auto;
  padding:0 18px;
}
.site-header{
  position:sticky; top:0; z-index:4;
  background:#fff;
  border-bottom:1px solid var(--border);
}
.site-header .container{
  display:flex; align-items:center; justify-content:space-between;
  min-height:62px;
}
.site-header h1{font-size:22px; margin:0; letter-spacing:.3px; color:#0b2440}
.nav{display:flex; gap:12px; align-items:center}
.nav a{
  color:var(--brand); text-decoration:none;
}
.nav a[aria-current="page"]{text-decoration:underline}
.site-footer{
  border-top:1px solid var(--border);
  color:var(--muted);
  margin-top:36px;
}
.site-footer .container{
  padding:16px 18px;
}

/* ---- Cards / blocks ---- */
.card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:22px;
  margin:22px auto;
}
h2{font-size:18px; margin:0 0 14px; color:#0b2440}

/* ---- Forms ---- */
.form{display:block}
.form-row{display:block; margin:12px 0}
.form-row .row{display:flex; gap:10px; align-items:center; flex-wrap:wrap}

/* Generic page wrapper used by camera/verifier/screens */
.wrap{width:100%; max-width:var(--maxw); margin:0 auto; padding:24px 18px}
.row{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.mb-8{margin-bottom:8px}
.mt-12{margin-top:12px}
.ml-auto{margin-left:auto}
.text-muted{color:var(--muted)}
.badge{display:inline-block; font-size:12px; font-weight:600; color:#0b2440; background:#e9f2ff; border:1px solid #cfe3ff; padding:2px 8px; border-radius:999px; margin-right:6px}
.code{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; background:#f1f5f9; border:1px solid #e2e8f0; border-radius:8px; padding:2px 8px; color:#0b2440}
/* Inline notice/callout */
.notice{background:#eef6ff; border:1px solid #cfe3ff; color:#0b2440; border-radius:10px; padding:10px 12px; margin-top:10px}

/* Video presentation */
video{display:block; width:100%; max-width:100%; background:#000; border-radius:12px; box-shadow:var(--shadow)}
.video-box{position:relative}
/* Ensure overlays can sit above video across browsers */
.video-box video{position:relative; z-index:1}
.video-overlay{position:absolute; inset:0; display:flex; align-items:center; justify-content:center; z-index:3; transform:translateZ(0)}
.video-overlay--start{z-index:4; background:rgba(15,23,42,.35)}
.video-countdown{position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:clamp(180px, 28vw, 320px); font-weight:800; color:#fff; background:rgba(0,0,0,.55); z-index:5; pointer-events:none; transform:translateZ(0)}

/* Self-check hints and spacing */
.hint{ padding:.5rem .75rem; background:#eef6ff; border:1px solid #cfe3ff; border-radius:6px; }
.step{ margin-top:.5rem; }

/* Big Start button overlay */
.video-overlay--start .btn-start{
  font-size:clamp(36px,7vw,56px);
  padding:28px 48px;
  height:auto;
  min-height:82px;
}

/* Consent section larger controls */
#consent label{ font-size:clamp(18px,3.2vw,22px); display:flex; align-items:center; gap:14px; line-height:1.35; padding:4px 0; }
#consent input[type="checkbox"]{ transform:scale(1.5); transform-origin:left center; }
#consent #startBtn{ height:auto; min-height:56px; padding:18px 28px; font-size:clamp(20px,4vw,28px); }

/* Step modal bits (moved from inline) */
.progress{height:8px; background:#e5e7eb; border-radius:999px; margin:4px 0 10px; overflow:hidden}
.progress-bar{height:100%; width:0%; background:var(--brand); transition:width .25s ease}
.step-text{white-space:pre-line}
.challenge-banner{
  position:absolute; left:50%; top:16px; transform:translateX(-50%);
  z-index:5;
  background:var(--brand); color:#fff; border:1px solid var(--brand-hover);
  border-radius:12px; box-shadow:0 10px 28px rgba(0,0,0,.22);
  padding:12px 18px; font-weight:700; letter-spacing:.2px;
  font-size:clamp(16px, 2.6vw, 20px);
  max-width:92%; text-align:center;
}

/* End overlay (for final thanks message) */
.end-overlay{position:absolute; inset:0; display:none; align-items:center; justify-content:center; background:rgba(15,23,42,.6); z-index:6;}
.end-overlay.show{display:flex}
.end-banner{background:var(--brand); color:#fff; border:1px solid var(--brand-hover); border-radius:14px; box-shadow:0 14px 32px rgba(0,0,0,.28); padding:18px 22px; font-weight:700; letter-spacing:.2px; font-size:clamp(18px, 3.2vw, 22px); max-width:min(720px, 92%); text-align:center}

/* Inputs: kompakte Breite (wie früher) */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"]{
  appearance:none;
  width:320px; max-width:100%;
  background:#ffffff;
  color:var(--text);
  border:1px solid #cbd5e1;
  border-radius:10px;
  padding:10px 12px;
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
select{
  appearance:none;
  width:320px; max-width:100%;
  background:#ffffff;
  color:var(--text);
  border:1px solid #cbd5e1;
  border-radius:10px;
  padding:10px 12px;
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
select:focus{border-color:var(--brand); box-shadow:var(--focus)}
input:focus{border-color:var(--brand); box-shadow:var(--focus)}
label{display:block; color:#0b2440; margin:0 0 6px; font-weight:600}

/* ---- Accordion (details/summary) ---- */
.accordion{border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow); background:#fff; margin:22px auto;}
.accordion > summary{
  list-style:none; cursor:pointer; user-select:none; outline:none;
  padding:16px 18px; font-weight:700; color:#0b2440; display:flex; align-items:center; gap:10px;
}
.accordion > summary:hover{background:#f8fafc}
.accordion[open] > summary{border-bottom:1px solid var(--border); margin-bottom:10px}
.accordion > summary::-webkit-details-marker{display:none}
.accordion .accordion-content{padding:0 18px 18px}
.accordion .row{margin-top:8px}

/* ---- Buttons / badges ---- */
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px; cursor:pointer; user-select:none;
  height:36px; padding:0 14px;
  color:#ffffff; background:var(--brand);
  border:1px solid var(--brand);
  border-radius:10px;
  transition:transform .05s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover{background:var(--brand-hover); border-color:var(--brand-hover); color:#ffffff}
.btn:active{transform:translateY(1px)}
.btn-outline{
  background:#ffffff;
  color:var(--brand);
  border-color:var(--brand);
}
.btn-outline:hover{background:var(--brand); border-color:var(--brand-hover); color:#ffffff}
.btn.secondary{background:#0ea5e9; border-color:#0ea5e9}
.btn.secondary:hover{background:#0284c7; border-color:#0284c7; color:#ffffff}
.btn-sm{height:30px; padding:0 10px; border-radius:8px}

/* Danger button */
.btn-danger{background:var(--danger); border-color:var(--danger); color:#ffffff}
.btn-danger:hover{background:#bb2d3b; border-color:#bb2d3b; color:#ffffff}

/* Success button */
.btn.btn-success{background:#16a34a; border-color:#16a34a; color:#ffffff}
.btn.btn-success:hover{background:#15803d; border-color:#15803d; color:#ffffff}

/* ---- Tables ---- */
.table{width:100%; border-collapse:collapse; margin-top:6px}
.table th,.table td{
  text-align:left; padding:10px 12px; border-bottom:1px solid var(--border);
  vertical-align:middle;
}
.table thead th{color:#0b2440; font-weight:700}
.table tbody tr:hover{background:#f8fafc}
.table td:last-child{display:flex; gap:8px; align-items:center; flex-wrap:wrap}

/* Segmented toggle (Live/Self) */
.seg-toggle{display:inline-flex; align-items:center; border:1px solid var(--brand); border-radius:999px; overflow:hidden; height:36px}
.seg-toggle .seg-btn{appearance:none; border:0; background:transparent; color:var(--brand); padding:0 14px; height:36px; display:inline-flex; align-items:center; font-weight:600; cursor:pointer}
.seg-toggle .seg-btn:hover{background:rgba(13,110,253,.08)}
.seg-toggle .seg-btn.is-active{background:var(--brand); color:#fff}
.seg-toggle .seg-btn:focus{outline:none; box-shadow:var(--focus)}
.seg-toggle .icon{width:16px; height:16px; display:inline-block; margin-right:6px}

/* ---- Toasts ---- */
.toasts{position:fixed; right:16px; bottom:16px; z-index:50; display:flex; flex-direction:column; gap:10px; align-items:flex-end}
.toast{display:flex; align-items:center; gap:10px; padding:10px 14px; border-radius:10px; box-shadow:var(--shadow); border:1px solid var(--border); background:#fff; color:var(--text); max-width:min(92vw, 420px); animation:toast-in .15s ease-out}
.toast.ok{border-color:#16a34a33}
.toast.ok .dot{background:#16a34a}
.toast.info{border-color:#0d6efd33}
.toast.info .dot{background:#0d6efd}
.toast.error{border-color:#dc354533}
.toast.error .dot{background:#dc3545}
.toast .dot{width:10px; height:10px; border-radius:999px; flex:0 0 auto}
.toast .msg{white-space:nowrap; text-overflow:ellipsis; overflow:hidden}
@keyframes toast-in{from{transform:translateY(6px); opacity:.0} to{transform:none; opacity:1}}

/* ---- Little bits ---- */
.divider{height:1px; background:var(--border); margin:14px 0}
.text-error{color:var(--danger); margin-top:6px}
.text-ok{color:var(--ok)}

/* ---- Screens gallery ---- */
.grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:12px}
.thumb{width:100%; height:auto; border-radius:8px; background:#f8fafc; border:1px solid var(--border)}

/* ---- Modal ---- */
.modal{position:fixed; inset:0; display:none; align-items:center; justify-content:center; background:rgba(15,23,42,.5); z-index:20}
.modal#infoModal{z-index:40}
.modal.open{display:flex}
.modal-dialog{background:#fff; border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow); max-width:520px; width:calc(100% - 32px); overflow:hidden}
.modal-dialog--wide{width:70vw; max-width:1200px}
.modal-header{display:flex; align-items:center; justify-content:space-between; padding:12px 14px; border-bottom:1px solid var(--border)}
.modal-title{margin:0; font-size:16px; color:#0b2440}
.modal-body{padding:12px 14px; max-height:70vh; overflow:auto}
.modal-footer{display:flex; gap:8px; justify-content:flex-end; padding:12px 14px; border-top:1px solid var(--border)}
.modal img{display:block; max-width:100%; height:auto}
.modal iframe{display:block; width:100%; height:70vh; border:0; background:#000; border-radius:8px}
.modal .modal-body video{max-height:60vh}
@media (max-width: 768px){
  .modal-dialog--wide{width:90vw}
}

/* Ensure the HTML hidden attribute always hides elements even if a CSS class sets display */
[hidden]{ display:none !important; }
