:root{
  --bg:#eef3f8;
  --card:#ffffff;
  --text:#172033;
  --muted:#5b6676;
  --line:#d8e0ea;
  --blue:#0b57d0;
  --blue-dark:#0845aa;
  --green:#147a37;
  --green-bg:#eaf8ee;
  --red:#b42318;
  --red-bg:#fff0ef;
  --dark:#111827;
  --shadow:0 12px 32px rgba(20,33,61,.10);
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;font-size:18px}
body{
  margin:0;
  background:linear-gradient(180deg,#eaf2ff 0,#f4f7fb 320px);
  color:var(--text);
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
}
button{font:inherit;touch-action:manipulation}
button:focus-visible, summary:focus-visible, a:focus-visible{
  outline:4px solid #f4b400;
  outline-offset:3px;
}
.app{width:min(100%,780px);margin:0 auto;padding:14px 12px 42px}
.screen{display:none}
.screen.active{display:block}

.home-card,.result-card,.error-card{
  min-height:calc(100vh - 72px);
  background:var(--card);
  border:1px solid var(--line);
  border-radius:28px;
  box-shadow:var(--shadow);
  padding:34px 22px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
}
.car-icon{
  width:96px;height:96px;border-radius:28px;
  background:#e9f2ff;display:grid;place-items:center;
  font-size:50px;margin-bottom:18px;
}
h1{
  margin:0 0 16px;
  font-size:clamp(38px,9vw,58px);
  line-height:1.08;
  letter-spacing:-.02em;
}
.lead{
  margin:0 0 20px;
  color:var(--muted);
  font-size:clamp(21px,5vw,26px);
  line-height:1.4;
  font-weight:700;
}
.load-state{
  width:100%;max-width:560px;
  margin:0 0 18px;padding:13px 16px;
  border-radius:15px;background:#f3f6fa;
  color:var(--muted);font-size:18px;font-weight:800;
}
.load-state.ready{background:#edf8f0;color:#166534}
.load-state.error{background:#fff1f0;color:#991b1b}
.hint{max-width:560px;color:var(--muted);font-size:19px;line-height:1.5;margin:20px 0}
.source-box{
  max-width:560px;width:100%;text-align:left;
  border:1px solid var(--line);border-radius:16px;
  padding:13px 15px;background:#fafbfc;color:var(--muted);
}
.source-box summary{font-weight:850;color:#344054;cursor:pointer;font-size:17px}
.source-box p{font-size:16px;line-height:1.55;margin-bottom:0}

.btn{
  border:0;border-radius:20px;font-weight:950;
  cursor:pointer;transition:transform .08s,background .15s,opacity .15s;
}
.btn:active{transform:scale(.985)}
.btn:disabled{opacity:.48;cursor:not-allowed}
.btn-primary{background:var(--blue);color:#fff;box-shadow:0 8px 20px rgba(11,87,208,.20)}
.btn-primary:hover:not(:disabled){background:var(--blue-dark)}
.btn-dark{background:var(--dark);color:#fff}
.btn-secondary{background:#e7ecf2;color:#243044}
.btn-huge{width:100%;max-width:560px;min-height:90px;padding:18px;font-size:29px}
.btn-large{width:100%;min-height:78px;padding:15px;font-size:24px}
.btn-medium{width:100%;min-height:60px;padding:12px;font-size:19px}

.status-wrap{
  position:sticky;top:0;z-index:5;
  background:rgba(238,243,248,.97);
  backdrop-filter:blur(8px);
  padding:8px 0 12px;
}
.status-grid{
  display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;
  background:#fff;border:1px solid var(--line);
  border-radius:20px;padding:10px;box-shadow:var(--shadow);
}
.stat{
  min-width:0;
  text-align:center;background:#f6f8fb;border-radius:14px;padding:10px 6px;
}
.stat span{display:block;font-size:13px;color:var(--muted);font-weight:900;letter-spacing:.04em}
.stat strong{display:block;margin-top:3px;font-size:25px;font-variant-numeric:tabular-nums}
.progress{height:9px;background:#dbe3ed;border-radius:999px;overflow:hidden;margin-top:9px}
.progress span{display:block;width:0;height:100%;background:var(--blue);transition:width .2s}

.question-card{
  background:#fff;border:1px solid var(--line);
  border-radius:25px;box-shadow:var(--shadow);
  padding:24px 18px 20px;
}
.question-text{
  margin:0 0 22px;
  font-size:clamp(28px,6vw,38px);
  line-height:1.28;
  letter-spacing:-.01em;
}
.question-image-wrap{
  margin:0 0 22px;
  background:#f6f8fa;border:1px solid var(--line);
  border-radius:18px;padding:8px;
  text-align:center;
}
.question-image{display:block;max-width:100%;width:auto;max-height:390px;margin:auto;border-radius:12px}
.multi-hint{
  margin:0 0 15px;padding:12px 14px;
  background:#eef5ff;color:#174b9b;
  border-radius:14px;font-size:18px;line-height:1.4;font-weight:800;
}
.answers{display:grid;gap:14px}
.answer{
  position:relative;width:100%;min-height:88px;
  border:3px solid var(--line);border-radius:21px;
  background:#fff;color:var(--text);
  padding:15px 14px 15px 82px;text-align:left;
  font-size:clamp(22px,4.8vw,27px);line-height:1.35;font-weight:760;
}
.answer .letter{
  position:absolute;left:15px;top:50%;transform:translateY(-50%);
  width:52px;height:52px;border-radius:16px;
  background:#edf1f6;display:grid;place-items:center;
  font-size:26px;font-weight:950;
}
.answer.selected{border-color:var(--blue);background:#f1f6ff}
.answer.selected .letter{background:var(--blue);color:#fff}
.answer.correct{border-color:#2b9e50;background:var(--green-bg);color:#14532d}
.answer.correct .letter{background:var(--green);color:#fff}
.answer.wrong{border-color:#df5a52;background:var(--red-bg);color:#7f1d1d}
.answer.wrong .letter{background:var(--red);color:#fff}

.feedback{
  display:none;margin-top:18px;border-radius:18px;padding:17px 18px;
  font-size:26px;font-weight:950;line-height:1.35;
}
.feedback.show{display:block}
.feedback.ok{background:var(--green-bg);border:2px solid #78ce92;color:#166534}
.feedback.bad{background:var(--red-bg);border:2px solid #ef9c96;color:#991b1b}
.feedback small{display:block;margin-top:7px;font-size:18px;line-height:1.45;font-weight:700}

.explanation{
  margin-top:14px;border:1px solid var(--line);border-radius:16px;
  padding:13px 15px;background:#fafbfc;
}
.explanation summary{cursor:pointer;font-size:18px;font-weight:900}
.explanation p{font-size:18px;line-height:1.55;color:#344054;margin-bottom:0}

.actions{display:grid;gap:11px;margin-top:19px}

.result-emoji{font-size:64px}
.result-title{margin:6px 0 0;font-size:48px}
.final-score{font-size:58px;font-weight:950;color:var(--blue);margin:12px 0 4px}
.result-message{font-size:22px;color:var(--muted);line-height:1.45;max-width:560px}
.result-stats{display:grid;grid-template-columns:1fr 1fr;gap:12px;width:100%;max-width:560px;margin:10px 0 22px}
.result-stats>div{background:#f6f8fb;border-radius:18px;padding:18px 10px}
.result-stats strong{display:block;font-size:36px}
.result-stats span{font-size:15px;font-weight:900;color:var(--muted)}
.error-card h2{font-size:36px}
.error-card p{font-size:21px;line-height:1.5;color:var(--muted);max-width:560px}

.footer{text-align:center;padding:18px 0 0;font-size:14px}
.footer a{color:#667085}

@media (max-width:520px){
  .app{padding:8px 7px 28px}
  .home-card,.result-card,.error-card{min-height:calc(100vh - 48px);border-radius:22px;padding:25px 14px}
  .status-grid{grid-template-columns:1fr 1fr}
  .timer-stat{grid-column:1/-1}
  .question-card{padding:20px 10px 16px;border-radius:21px}
  .question-text{font-size:29px}
  .answer{min-height:92px;padding-left:80px;font-size:23px}
  .btn-huge{min-height:94px;font-size:28px}
}

.home-license{
  margin-top:14px;
  font-size:14px;
  text-align:center;
}
.home-license a{
  color:#7a8492;
  text-decoration:none;
}
.home-license a:hover{
  text-decoration:underline;
}

/* V5 — aspect apropiat de interfața de examen */
:root{
  --exam-bg:#f1f3fa;
  --exam-panel:#ffffff;
  --exam-line:#d9deea;
  --exam-text:#3d4a6a;
  --exam-yellow:#ffd33f;
  --exam-yellow-soft:#ffe699;
  --exam-green:#57b957;
  --exam-red:#c9302c;
  --exam-neutral:#e3e7ef;
}

body{
  background:var(--exam-bg);
  color:var(--exam-text);
}

.app{
  width:min(100%,1180px);
  max-width:1180px;
  padding-top:0;
}

.status-wrap{
  background:rgba(241,243,250,.98);
  padding-top:0;
}

.status-grid.exam-status{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:0;
  background:#fff;
  border:1px solid var(--exam-line);
  border-radius:0;
  padding:0;
  box-shadow:none;
}

.exam-status .stat{
  background:#fff;
  border-radius:0;
  padding:14px 8px;
  min-height:86px;
  border-right:1px solid var(--exam-line);
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
}
.exam-status .stat:last-child{border-right:0}
.exam-status .stat strong{
  order:0;
  font-size:31px;
  color:var(--exam-text);
  font-weight:500;
  margin:0 0 5px;
}
.exam-status .stat span{
  order:1;
  font-size:15px;
  letter-spacing:0;
  color:var(--exam-text);
  font-weight:500;
  text-transform:none;
}
.exam-status .correct-stat strong{color:#16b21b}
.exam-status .wrong-stat strong{color:#d52316}
.exam-status .timer-stat strong{font-size:34px;font-weight:400}

.question-counter{
  text-align:center;
  font-size:17px;
  color:var(--exam-text);
  margin:8px 0 4px;
}

.progress{
  height:5px;
  margin-top:5px;
  background:#d9deea;
}
.progress span{background:#66779f}

.question-card{
  background:transparent;
  border:0;
  border-radius:0;
  box-shadow:none;
  padding:38px 18px 24px;
}

.question-text{
  color:var(--exam-text);
  text-align:center;
  font-size:clamp(30px,4vw,40px);
  font-weight:500;
  margin-bottom:28px;
}

.exam-question-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(320px,.95fr);
  gap:44px;
  align-items:start;
}

.answers-column{
  min-width:0;
}

.multi-hint{
  background:#fff;
  color:#5d6885;
  border:1px solid var(--exam-line);
  font-size:16px;
  font-weight:600;
  margin-bottom:16px;
  padding:11px 14px;
}

.answers{
  gap:16px;
}

.answer{
  min-height:100px;
  border:1px solid #cfd5e1;
  border-radius:4px;
  background:#fff;
  color:var(--exam-text);
  box-shadow:0 2px 6px rgba(32,46,79,.12);
  padding:18px 18px 18px 105px;
  font-size:25px;
  font-weight:500;
}

.answer .letter{
  left:0;
  top:0;
  transform:none;
  width:82px;
  height:100%;
  min-height:98px;
  border-radius:3px 0 0 3px;
  background:#e2e6ee;
  color:var(--exam-text);
  font-size:38px;
  font-weight:700;
}

.answer.selected{
  border-color:#e0b528;
  background:var(--exam-yellow-soft);
}
.answer.selected .letter{
  background:var(--exam-yellow);
  color:var(--exam-text);
}

.answer.correct{
  border-color:#4caf50;
  background:#dff3df;
  color:#225c2a;
}
.answer.correct .letter{
  background:var(--exam-green);
  color:#fff;
}

.answer.wrong{
  border-color:#c94a44;
  background:#f7d9d7;
  color:#7e2520;
}
.answer.wrong .letter{
  background:var(--exam-red);
  color:#fff;
}

.question-image-wrap{
  background:#fff;
  border:0;
  border-radius:0;
  padding:10px;
  margin:0;
  box-shadow:0 8px 18px rgba(31,43,71,.18);
  min-height:250px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.question-image-wrap[hidden]{display:none !important}

.question-image{
  max-height:460px;
  width:100%;
  object-fit:contain;
  border-radius:0;
}

.feedback{
  max-width:760px;
  margin:22px auto 0;
  text-align:center;
}

.actions{
  max-width:760px;
  margin:22px auto 0;
  grid-template-columns:1fr;
}

.check{
  background:var(--exam-green);
}
.check:hover:not(:disabled){background:#49a949}
.next{
  background:#3d4a6a;
}

.home-card,.result-card,.error-card{
  color:var(--exam-text);
}

@media (max-width:800px){
  .status-grid.exam-status{
    grid-template-columns:repeat(2,1fr);
  }
  .exam-status .stat{
    border-bottom:1px solid var(--exam-line);
  }
  .exam-status .timer-stat{
    grid-column:1/-1;
  }
  .exam-question-layout{
    grid-template-columns:1fr;
    gap:20px;
  }
  .question-image-wrap{
    order:-1;
    min-height:0;
  }
  .question-card{
    padding:24px 8px 18px;
  }
}

@media (max-width:520px){
  .app{padding-left:6px;padding-right:6px}
  .exam-status .stat{
    min-height:78px;
    padding:10px 4px;
  }
  .exam-status .stat strong{font-size:27px}
  .exam-status .stat span{font-size:13px;line-height:1.2}
  .exam-status .timer-stat strong{font-size:31px}

  .question-text{
    font-size:30px;
    margin-bottom:20px;
  }

  .answer{
    min-height:96px;
    padding-left:91px;
    font-size:23px;
    line-height:1.3;
  }
  .answer .letter{
    width:72px;
    min-height:94px;
    font-size:34px;
  }

  .question-image-wrap{
    padding:6px;
  }
  .question-image{
    max-height:340px;
  }
}
