/* ==================================================================
   Anketa – slogan tima | stil
   Mobile-first (većina kolega otvara link sa telefona)
   ================================================================== */

:root {
  --bg:        #0e1524;
  --bg-soft:   #16203a;
  --card:      #ffffff;
  --ink:       #14203a;
  --ink-soft:  #5a6a85;
  --line:      #e3e8f0;
  --brand:     #ff6b18;
  --brand-2:   #ff9245;
  --accent:    #12b886;
  --danger:    #e03131;
  --radius:    16px;
  --shadow:    0 10px 30px rgba(9, 20, 44, .10);
  --shadow-lg: 0 20px 50px rgba(9, 20, 44, .18);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  line-height: 1.6;
  background:
    radial-gradient(1100px 600px at 15% -10%, #23325a 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #3a2350 0%, transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  padding: 18px 14px 40px;
}

.wrap          { max-width: 720px; margin: 0 auto; }
.wrap--narrow  { max-width: 420px; }
.wrap--wide    { max-width: 1040px; }

/* ---------------------------- HERO ---------------------------- */
.hero { text-align: center; color: #fff; padding: 22px 6px 26px; }
.hero--slim { padding: 18px 6px 20px; }

.hero__badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 107, 24, .16);
  border: 1px solid rgba(255, 146, 69, .45);
  color: #ffb27a;
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 6vw, 38px);
  line-height: 1.2;
  letter-spacing: -.02em;
}
.hero h1 span {
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.hero__lead { margin: 0 auto 10px; max-width: 56ch; color: #d8def0; font-size: 16px; }
.hero__note { margin: 0 auto; max-width: 56ch; color: #a9b4cc; font-size: 14.5px; }
.hero__note strong { color: #ffb27a; }

/* ---------------------------- KARTICA ---------------------------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 22px 18px;
  margin: 0 0 18px;
}

.card__title {
  font-size: 16px;
  margin: 22px 0 6px;
  letter-spacing: -.01em;
}
.card__title:first-of-type { margin-top: 0; }
.card__title .req { color: var(--brand); }
.card__title .opt { color: var(--ink-soft); font-weight: 400; font-size: 14px; }

.hint      { margin: 0 0 12px; color: var(--ink-soft); font-size: 14px; }
.fineprint { margin: 14px 0 0; text-align: center; color: var(--ink-soft); font-size: 13px; }
.muted     { color: var(--ink-soft); }
.center    { text-align: center; }
.nowrap    { white-space: nowrap; }

/* ---------------------------- OPCIJE ---------------------------- */
.options { display: grid; gap: 10px; margin-bottom: 6px; }

.option {
  position: relative;
  display: grid;
  grid-template-columns: 26px 30px 1fr;
  align-items: center;
  gap: 10px;
  padding: 14px 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .12s;
  background: #fbfcfe;
}
.option:hover { border-color: #ffcaa8; background: #fff8f3; }
.option:active { transform: scale(.995); }

.option input { position: absolute; opacity: 0; pointer-events: none; }

.option__mark {
  width: 22px; height: 22px;
  border: 2px solid #c6cede;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  transition: border-color .18s;
}
.option__mark::after {
  content: "";
  position: absolute; inset: 4px;
  border-radius: 50%;
  background: var(--brand);
  transform: scale(0);
  transition: transform .18s cubic-bezier(.3, 1.6, .5, 1);
}

.option__num {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: #eef1f7;
  color: var(--ink-soft);
  font-size: 13px; font-weight: 700;
}

.option__text { font-size: 15.5px; font-weight: 500; }

.option input:checked ~ .option__mark { border-color: var(--brand); }
.option input:checked ~ .option__mark::after { transform: scale(1); }
.option input:checked ~ .option__num { background: var(--brand); color: #fff; }
/* .is-checked postavlja JavaScript – podrška i za starije browsere */
.option.is-checked,
.option:has(input:checked) {
  border-color: var(--brand);
  background: linear-gradient(180deg, #fff6f0 0%, #fff 100%);
  box-shadow: 0 6px 18px rgba(255, 107, 24, .16);
}
.option input:focus-visible ~ .option__mark { outline: 3px solid rgba(255, 107, 24, .35); outline-offset: 3px; }

/* ---------------------------- POLJA ---------------------------- */
.field { position: relative; margin-bottom: 6px; }

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  font: inherit;
  font-size: 15.5px;
  color: var(--ink);
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
  transition: border-color .18s, box-shadow .18s;
  resize: vertical;
}
input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(255, 107, 24, .13);
  background: #fff;
}
::placeholder { color: #a6b0c4; }

.counter {
  text-align: right;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 4px;
}

/* ---------------------------- DUGMAD ---------------------------- */
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.actions--center { justify-content: center; margin: 0 0 18px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 20px;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s, box-shadow .18s, opacity .18s, background .18s;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 107, 24, .32);
}
.btn--primary:disabled {
  background: #d7dde8;
  color: #97a2b6;
  box-shadow: none;
  cursor: not-allowed;
}

.btn--ghost {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .22);
  color: #e7ebf5;
}
.card .btn--ghost { background: #fff; border-color: var(--line); color: var(--ink-soft); }

.btn--danger { background: #fff0f0; color: var(--danger); border-color: #ffd5d5; padding: 6px 10px; }
.btn--lg  { flex: 1; padding: 15px 22px; font-size: 16.5px; }
.btn--sm  { font-size: 13px; padding: 6px 12px; }

/* ---------------------------- PORUKE ---------------------------- */
.alert {
  border-radius: 12px;
  padding: 13px 16px;
  margin-bottom: 16px;
  font-size: 14.5px;
}
.alert ul { margin: 0; padding-left: 18px; }
.alert--error { background: #fff2f2; color: #9b1c1c; border: 1px solid #ffd3d3; }
.alert--ok    { background: #eafaf2; color: #0a6b48; border: 1px solid #b8ecd4; }

/* ---------------------------- POTVRDA GLASA ---------------------------- */
.card--done { text-align: center; }
.done__icon { font-size: 46px; line-height: 1; margin-bottom: 6px; }
.card--done h2 { margin: 0 0 6px; font-size: 22px; }

.quote {
  margin: 12px 0 16px;
  padding: 16px 18px;
  border-left: 4px solid var(--brand);
  background: #fff7f2;
  border-radius: 0 12px 12px 0;
  font-size: 17px;
  font-weight: 600;
  font-style: italic;
}

/* ---------------------------- REZULTATI ---------------------------- */
.results { display: grid; gap: 16px; }

.result { padding: 12px 12px 10px; border-radius: 12px; background: #fbfcfe; border: 1px solid var(--line); }
.result--lead { border-color: #ffcaa8; background: linear-gradient(180deg, #fff8f3, #fff); }
.result--mine { box-shadow: inset 0 0 0 2px rgba(18, 184, 134, .35); }

.result__head {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: start;
  gap: 8px;
  margin-bottom: 8px;
}
.result__rank { font-size: 16px; font-weight: 800; color: var(--ink-soft); }
.result__text { font-size: 15px; font-weight: 600; }
.result__num  { font-size: 15px; font-weight: 800; color: var(--brand); white-space: nowrap; }
.result__num small { font-weight: 500; color: var(--ink-soft); font-size: 12px; }
.result__pct  { text-align: right; font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; }

.tag {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #0a6b48;
  background: #d8f6e8;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: 1px;
}

.bar {
  height: 12px;
  background: #edf0f6;
  border-radius: 999px;
  overflow: hidden;
}
.bar__fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 100%);
  animation: grow .9s cubic-bezier(.2, .8, .3, 1) forwards;
}
.result--lead .bar__fill { background: linear-gradient(90deg, #ff5a00 0%, #ffb020 100%); }

@keyframes grow { to { width: var(--w); } }

@media (prefers-reduced-motion: reduce) {
  .bar__fill { animation: none; width: var(--w); }
}

/* ---------------------------- PREDLOZI ---------------------------- */
.suggestions { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.suggestions li {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f7f9fc;
  border: 1px solid var(--line);
}
.suggestions__text { display: block; font-size: 15px; font-weight: 500; font-style: italic; }
.suggestions__meta { display: block; margin-top: 4px; font-size: 12.5px; color: var(--ink-soft); }

/* ---------------------------- ADMIN ---------------------------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.table tbody tr:hover { background: #fafbfd; }

.inline-form { display: flex; gap: 8px; margin-bottom: 14px; }
.inline-form input { flex: 1; }

.slogan-admin { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.slogan-admin li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14.5px;
}
.slogan-admin li.is-off { opacity: .5; text-decoration: line-through; }

/* ---------------------------- PODNOŽJE ---------------------------- */
.foot { text-align: center; color: #8f9ab3; font-size: 13px; padding: 8px 0 4px; }

/* ---------------------------- DESKTOP ---------------------------- */
@media (min-width: 640px) {
  body { padding: 32px 20px 56px; }
  .card { padding: 28px 26px; }
  .option { padding: 16px 18px; }
  .btn--lg { flex: 0 0 auto; }
}
