/* Same look as infoticedu.ro (colors, font, header) */
@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@500;700;800&display=swap");

:root {
  --bg: #f4f8ff;
  --surface: #ffffff;
  --text: #1f2a44;
  --muted: #5b6785;
  --accent: #3d68e8;
  --accent-dark: #2b4bb5;
  --border: #d5dcec;
  --error: #b42318;
  --error-bg: #fdecea;
  --ok: #087f63;
  --shadow: 0 6px 18px rgba(31, 42, 68, 0.12);
  --radius: 18px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Nunito", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 10% 10%, rgba(255, 209, 102, 0.25) 0, transparent 35%),
    radial-gradient(circle at 90% 20%, rgba(6, 214, 160, 0.18) 0, transparent 35%);
  line-height: 1.6;
  min-height: 100vh;
}
:focus-visible { outline: 4px solid #ffb703; outline-offset: 3px; }

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  padding: 18px 16px;
  box-shadow: var(--shadow);
}
.header-inner { max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.header-home { display: block; flex-shrink: 0; border-radius: 14px; }
.header-logo {
  display: block; width: 56px; height: 56px;
  background: #fff; border-radius: 14px; padding: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.header-title { margin: 0; font-size: 1.6rem; font-weight: 800; line-height: 1.2; }
.header-meta { margin: 2px 0 0; font-weight: 700; opacity: 0.9; }

/* ---------- Layout ---------- */
.page { max-width: 640px; margin: 24px auto 48px; padding: 0 16px; }
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

/* ---------- Fields ---------- */
.field { margin-bottom: 20px; }
label, .label { display: block; font-weight: 800; margin-bottom: 6px; }
input[type="text"], select {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
}
input[type="text"]:focus, select:focus { border-color: var(--accent); outline: none; }
.code-input { text-transform: uppercase; letter-spacing: 0.15em; font-weight: 800; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 0.95rem; }

/* Result of the live code check */
.code-status { margin: 8px 0 0; font-weight: 800; }
.code-status.ok { color: var(--ok); }
.code-status.bad { color: var(--error); }

/* Evaluation items */
.evaluare {
  margin: -4px 0 20px;
  padding: 16px 18px;
  background: #f4f6fb;
  border-left: 5px solid var(--accent);
  border-radius: 12px;
}
.evaluare h2 { margin: 0 0 8px; font-size: 1.15rem; }
.ev-itemi { margin: 0; padding-left: 1.4em; }
.ev-itemi li { padding: 4px 0; border-bottom: 1px solid var(--border); }
.ev-itemi li:last-child { border-bottom: 0; }
.ev-row { display: flex; gap: 12px; justify-content: space-between; align-items: baseline; }
.ev-text { overflow-wrap: anywhere; }
.ev-points { font-weight: 800; white-space: nowrap; color: var(--accent-dark); }
.ev-total { margin: 10px 0 0; font-weight: 800; text-align: right; }

/* Honeypot: off-screen, not display:none (some bots skip hidden fields) */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); border: 0;
}

/* ---------- File picker ---------- */
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-align: center; font-weight: 500;
  padding: 22px 16px;
  border: 2px dashed var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.drop:hover, .drop.dragover { border-color: var(--accent); background: #eef3ff; }
.drop strong { color: var(--accent-dark); }
.drop-icon { font-size: 1.8rem; }
/* The real file input is hidden; show keyboard focus on the drop zone instead */
#fisiere:focus-visible + .drop { outline: 4px solid #ffb703; outline-offset: 3px; }

.file-list { list-style: none; margin: 10px 0 0; padding: 0; }
.file-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; margin-bottom: 6px;
  background: #f4f6fb; border-radius: 10px;
}
.file-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 700; }
.file-size { color: var(--muted); white-space: nowrap; }
.file-remove {
  border: 0; background: none; cursor: pointer;
  font-size: 1.2rem; line-height: 1; padding: 4px 6px; border-radius: 8px; color: var(--muted);
}
.file-remove:hover { background: var(--error-bg); color: var(--error); }
.file-list li.bad { background: var(--error-bg); }
.file-list li.bad .file-size { color: var(--error); }
#total.over { color: var(--error); font-weight: 800; }

/* Turnstile widget: centered, keeps its space while loading */
.turnstile { display: flex; justify-content: center; min-height: 65px; margin-bottom: 16px; }

/* ---------- Messages, progress, buttons ---------- */
.message { padding: 12px 14px; border-radius: 12px; font-weight: 700; margin: 0 0 16px; }
.message.error { background: var(--error-bg); color: var(--error); }

.progress { margin-bottom: 16px; }
.progress-bar { height: 12px; background: #e6ebf5; border-radius: 999px; overflow: hidden; }
#progress-fill { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }

.btn {
  display: block; width: 100%;
  font: inherit; font-size: 1.1rem; font-weight: 800;
  padding: 12px 20px;
  border: 0; border-radius: 999px;
  background: var(--accent); color: #fff;
  cursor: pointer;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn-secondary { background: #e6ebf5; color: var(--text); }
.btn-secondary:hover { background: #d5dcec; }

/* ---------- Success ---------- */
.success { text-align: center; }
.success-icon { font-size: 3rem; }
.success h2 { margin: 4px 0 16px; color: var(--ok); }
.receipt {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 16px;
  text-align: left; margin: 0 0 12px;
  padding: 16px; background: #f4f6fb; border-radius: 12px;
}
.receipt dt { font-weight: 800; color: var(--muted); }
.receipt dd { margin: 0; overflow-wrap: anywhere; }
.receipt-id { font-size: 1.4rem; font-weight: 800; letter-spacing: 0.1em; color: var(--accent-dark); }
.success .btn { margin-top: 16px; }

@media (max-width: 420px) {
  .card { padding: 18px; }
  .header-title { font-size: 1.35rem; }
  .receipt { grid-template-columns: 1fr; }
  .receipt dd { margin-bottom: 6px; }
}
