:root{
  --bg1:#f7f9ff;
  --bg2:#eef2ff;

  --card: rgba(255,255,255,.78);
  --cardSolid:#ffffff;

  --text:#0f172a;
  --muted:#475569;

  --border: rgba(148,163,184,.55);
  --shadow: 0 18px 55px rgba(15, 23, 42, .12);

  --accent:#6366f1;   /* indigo */
  --accent2:#22c55e;  /* green */
  --danger:#ef4444;
  --warn:#f59e0b;

  --radius:26px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);

  /* Friendly + professional gradient background */
  background:
    radial-gradient(1100px 720px at 18% 10%, rgba(99,102,241,.22) 0%, transparent 55%),
    radial-gradient(900px 600px at 82% 28%, rgba(34,197,94,.18) 0%, transparent 60%),
    radial-gradient(950px 700px at 60% 85%, rgba(56,189,248,.18) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg2) 0%, var(--bg1) 100%);
}

.bg{
  min-height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:42px 18px 24px;
  gap:16px;
}

/* Bigger + taller card, still leaves page margins for future banner ads */
.card{
  width:min(920px, 100%);
  min-height:82vh;
  max-height:calc(100vh - 120px);

  background: var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  backdrop-filter: blur(10px);

  padding:34px;
  position:relative;
  overflow:auto;
}

.header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:18px;
}

.titleWrap h1{
  margin:0;
  font-size:28px;
  letter-spacing:.2px;
}

.titleWrap p{
  margin:10px 0 0;
  color:var(--muted);
  line-height:1.45;
  font-size:15px;
}

.linkBtn{
  border:1px solid rgba(148,163,184,.6);
  background: rgba(255,255,255,.7);
  color:var(--text);
  padding:9px 12px;
  border-radius:999px;
  font-size:13px;
  cursor:pointer;
  transition: transform .06s ease, background .2s ease, box-shadow .2s ease;
  box-shadow: 0 10px 25px rgba(15, 23, 42, .06);
}
.linkBtn:hover{ background: rgba(255,255,255,.95); }
.linkBtn:active{ transform: translateY(1px); }

.section{
  margin-top:14px;
}

/* Taller upload box + centered icon */
.dropzone{
  border:1px dashed rgba(148,163,184,.8);
  background: rgba(255,255,255,.62);
  border-radius:20px;
  padding:34px 28px;
  text-align:center;
  cursor:pointer;
  transition: border-color .2s ease, background .2s ease, transform .06s ease, box-shadow .2s ease;
  user-select:none;

  min-height:240px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
}
.dropzone:hover{
  border-color: rgba(99,102,241,.9);
  background: rgba(255,255,255,.9);
  box-shadow: 0 18px 45px rgba(15, 23, 42, .10);
}
.dropzone:active{ transform: translateY(1px); }

.uploadIcon{
  width:54px;
  height:54px;
  fill: rgba(99,102,241,.95);
  opacity:.95;
  margin-bottom:2px;
}

.dropTitle{
  font-size:18px;
  margin:0;
}
.dropSub{
  margin:2px 0 0;
  color:var(--muted);
  font-size:14px;
  line-height:1.35;
}

.filePill{
  display:inline-flex;
  align-items:center;
  gap:10px;
  margin-top:12px;
  padding:9px 13px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.55);
  background: rgba(255,255,255,.85);
  color:var(--text);
  font-size:13px;
}
.filePill .muted{ color:var(--muted); }

.controls{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-top:18px;
  flex-wrap:wrap;
}
.controlRow{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
label{
  font-size:13px;
  color:var(--muted);
}
select,
input[type="number"]{
  background: rgba(255,255,255,.9);
  border:1px solid rgba(148,163,184,.65);
  color:var(--text);
  padding:11px 12px;
  border-radius:14px;
  font-size:14px;
  outline:none;
}

.primaryBtn{
  background: linear-gradient(180deg, rgba(99,102,241,1) 0%, rgba(56,189,248,1) 100%);
  border:none;
  color:white;
  padding:12px 18px;
  border-radius:16px;
  font-weight:700;
  font-size:15px;
  cursor:pointer;
  transition: transform .06s ease, filter .2s ease, opacity .2s ease;
  box-shadow: 0 16px 35px rgba(99,102,241,.22);
}
.primaryBtn:hover{ filter:brightness(1.03); }
.primaryBtn:active{ transform: translateY(1px); }
.primaryBtn:disabled{
  opacity:.55;
  cursor:not-allowed;
  box-shadow:none;
}

.note{
  margin-top:14px;
  color:var(--muted);
  font-size:14px;
  line-height:1.45;
}
.note.subtle{
  margin-top:12px;
  font-size:13px;
  opacity:.9;
}

.loadingTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:4px;
}
.statusWrap{
  display:flex;
  align-items:center;
  gap:12px;
}
.spinner{
  width:18px;
  height:18px;
  border-radius:50%;
  border:2px solid rgba(148,163,184,.55);
  border-top-color: rgba(99,102,241,1);
  animation: spin 1s linear infinite;
}
@keyframes spin{ to { transform: rotate(360deg); } }

.statusTitle{
  margin:0;
  font-weight:750;
  font-size:15px;
}
.statusSub{
  margin:6px 0 0;
  color:var(--muted);
  font-size:14px;
}

.cancelBtn{
  border:1px solid rgba(148,163,184,.7);
  background: rgba(255,255,255,.75);
  color:var(--text);
  padding:11px 14px;
  border-radius:14px;
  font-size:14px;
  cursor:pointer;
  transition: background .2s ease, transform .06s ease;
}
.cancelBtn:hover{ background: rgba(255,255,255,.95); }
.cancelBtn:active{ transform: translateY(1px); }

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid rgba(148,163,184,.55);
  background: rgba(255,255,255,.75);
  padding:10px 12px;
  border-radius:14px;
  font-size:14px;
  color:var(--muted);
  margin-top:12px;
}
.badge strong{ color: var(--text); }

/* One-at-a-time log, fades between lines */
.logPanel{
  margin-top:16px;
  border:1px solid rgba(148,163,184,.55);
  background: rgba(255,255,255,.7);
  border-radius:18px;
  padding:14px;
  min-height:72px;
  display:flex;
  align-items:center;
  overflow:hidden;
  position:relative;
}

.logSingle{
  width:100%;
  display:flex;
  gap:10px;
  align-items:flex-start;
  font-size:14px;
  line-height:1.35;
}

.logTime{
  color: rgba(71,85,105,.95);
  font-variant-numeric: tabular-nums;
  white-space:nowrap;
}

.logMsg{
  color: rgba(15,23,42,.92);
}

/* incoming/outgoing animations */
.logSingle.in{
  animation: logIn .28s ease-out both;
}
.logSingle.out{
  position:absolute;
  inset:14px;
  animation: logOut .28s ease-in both;
}

@keyframes logIn{
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes logOut{
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-4px); }
}

/* Quiz */
.quizTop{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-top:8px;
}
.quizTop h2{
  margin:0;
  font-size:22px;
}
.progress{
  margin-top:8px;
  color:var(--muted);
  font-size:14px;
}

.qText{
  margin:18px 0 12px;
  font-size:16px;
  line-height:1.55;
}

.choices{
  display:grid;
  gap:12px;
}
.choice{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding:14px;
  border:1px solid rgba(148,163,184,.55);
  border-radius:16px;
  background: rgba(255,255,255,.72);
  cursor:pointer;
  transition: background .2s ease, transform .06s ease, border-color .2s ease, box-shadow .2s ease;
}
.choice:hover{
  background: rgba(255,255,255,.95);
  border-color: rgba(99,102,241,.6);
  box-shadow: 0 14px 35px rgba(15, 23, 42, .08);
}
.choice:active{ transform: translateY(1px); }
.choice input{ margin-top:3px; }

.choice{
  justify-content:space-between;
}

.choiceMain{
  display:flex;
  gap:10px;
  align-items:flex-start;
}

.choiceText{
  display:block;
}

.verdict{
  min-width:24px;
  text-align:center;
  font-size:18px;
  font-weight:800;
  line-height:1;
  margin-left:10px;
}

.verdict.spacer{
  opacity:0;
}

.verdict.vOk{ color: #16a34a; }
.verdict.vBad{ color: #dc2626; }


.feedback{
  margin-top:16px;
  padding:14px;
  border-radius:16px;
  border:1px solid rgba(148,163,184,.55);
  background: rgba(255,255,255,.75);
}
.feedback strong{
  display:inline-block;
  margin-bottom:8px;
}
.correct{ color: #16a34a; }
.incorrect{ color: #dc2626; }
.expl{
  color: rgba(15,23,42,.92);
  line-height:1.5;
  font-size:14.5px;
}

.bottomBar{
  display:flex;
  justify-content:flex-end;
  margin-top:18px;
}

.resultsScore{
  font-size:20px;
  margin:12px 0 16px;
}

.resultItem{
  border:1px solid rgba(148,163,184,.55);
  background: rgba(255,255,255,.72);
  border-radius:18px;
  padding:14px;
  margin-top:12px;
}
.resultItem .q{
  margin:0 0 10px;
  font-size:14.5px;
  line-height:1.5;
}
.ansLine{
  margin:6px 0;
  font-size:14px;
  color:var(--muted);
}
.hlGood{ color:#16a34a; }
.hlBad{ color:#dc2626; }

details summary{
  cursor:pointer;
  color: rgba(99,102,241,.95);
  font-size:14px;
  margin-top:10px;
}
details .explText{
  margin-top:10px;
  color: rgba(15,23,42,.9);
  font-size:14.5px;
  line-height:1.5;
}

.btnRow{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:18px;
}
.secondaryBtn{
  border:1px solid rgba(148,163,184,.7);
  background: rgba(255,255,255,.75);
  color:var(--text);
  padding:12px 16px;
  border-radius:16px;
  font-weight:700;
  font-size:15px;
  cursor:pointer;
  transition: background .2s ease, transform .06s ease;
}
.secondaryBtn:hover{ background: rgba(255,255,255,.95); }
.secondaryBtn:active{ transform: translateY(1px); }

.footer{
  color: rgba(71,85,105,.9);
  font-size:13px;
}

.mobileNotice{
  display:none;
  width:min(920px, 100%);
  border:1px solid rgba(245,158,11,.35);
  background: rgba(245,158,11,.16);
  color:#7c2d12;
  padding:12px 14px;
  border-radius:16px;
  font-size:14px;
}

@media (max-width: 640px){
  .mobileNotice{ display:block; }
  .card{
    min-height:auto;
    max-height:none;
    padding:24px;
  }
  .titleWrap h1{ font-size:24px; }
}


/* ===== Scrollbar styling (matches the app UI) =====
   Applies to the main card scroller so the scrollbar
   doesn't look like a default OS control and doesn't
   clash with the rounded borders.
*/
.card{
  /* Reserve space so the scrollbar doesn't sit on top of the border */
  scrollbar-gutter: stable;
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: transparent transparent; /* Firefox */
}

/* Chrome / Edge / Safari */
.card::-webkit-scrollbar{
  width: 12px;
}

.card::-webkit-scrollbar-track{
  background: transparent;
  /* Keep the track away from rounded corners */
  margin: 100px 10px;
}

.card::-webkit-scrollbar-thumb{
  background-color: rgba(148,163,184,.65);
  border-radius: 999px;

  /* Creates an inset look so it doesn't touch the border */
  border: 3px solid rgba(255,255,255,.65);
  background-clip: padding-box;
}

.card::-webkit-scrollbar-thumb:hover{
  background-color: rgba(100,116,139,.75);
}

/* Remove scrollbar arrow buttons */
.card::-webkit-scrollbar-button {
  display: none;
  height: 0;
  width: 0;
}


/* ===== PDF export controls ===== */
.mutedLine{
  margin:10px 0 0;
  color: var(--muted);
  font-size:14px;
  line-height:1.45;
}

.pdfHint{
  display:flex;
  gap:10px;
  align-items:baseline;
  flex-wrap:wrap;
  margin:10px 0 14px;
  color: var(--muted);
  font-size:14px;
}

.pdfHint .muted{
  opacity:.9;
}

.resultItem{
  position:relative;
}

.qRemove{
  position:absolute;
  top:10px;
  right:10px;
  width:28px;
  height:28px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.65);
  background: rgba(255,255,255,.85);
  color: rgba(239,68,68,1);
  font-size:18px;
  font-weight:800;
  line-height:1;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition: transform .06s ease, background .2s ease, box-shadow .2s ease, opacity .2s ease;
  box-shadow: 0 10px 25px rgba(15, 23, 42, .06);
}

.qRemove:hover{
  background: rgba(255,255,255,.98);
}

.qRemove:active{
  transform: translateY(1px);
}

.resultItem.excluded{
  opacity:.55;
}

.excludedNote{
  margin-top:10px;
  font-size:13px;
  color: rgba(239,68,68,1);
  font-weight:700;
}

/* Hide question delete X when generating / printing PDF */
.pdf-export .question-delete {
  display: none !important;
}
