@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Roboto+Condensed:wght@400;700&display=swap');

/* ── Design tokens (same as admin) ──────────────────────────── */
:root {
  --c-primary:  #1b577a;
  --c-accent:   #1174ad;
  --c-bg:       #f0f3f7;
  --c-surface:  #ffffff;
  --c-border:   #e2e8ef;
  --c-text:     #1e2d3d;
  --c-muted:    #6b7a8d;
  --c-error:    #bf3131;
  --r-md: 10px;
  --r-lg: 14px;
}

* { box-sizing: border-box; -webkit-appearance: none; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: "Inter", Helvetica, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  touch-action: manipulation;
}

a { color: var(--c-accent); text-decoration: none; }

/* ── Page wrapper ──────────────────────────────────────────── */

.page {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 60px;
}

/* ── Main card ─────────────────────────────────────────────── */

.ticket {
  width: min(700px, 100%);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.07), 0 8px 32px rgba(0,0,0,.06);
}

/* ── Card head ─────────────────────────────────────────────── */

.ticket_head {
  padding: 24px 24px 18px;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-accent) 100%);
  color: #fff;
}

.title {
  font-family: "Roboto Condensed", sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.2px;
  color: #fff;
}

.subtitle {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255,255,255,.72);
  line-height: 1.5;
}

.subtitle a { color: rgba(255,255,255,.85); text-decoration: underline; }

/* ── Progress ──────────────────────────────────────────────── */

.progress {
  margin-top: 18px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,.25);
  overflow: hidden;
}

.progress_bar {
  height: 100%;
  width: 0%;
  background: rgba(255,255,255,.9);
  border-radius: 3px;
  transition: width 200ms ease;
}

/* ── Step nav ──────────────────────────────────────────────── */

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.step_btn {
  border: 1.5px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.7);
  padding: 9px 8px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background .15s, border-color .15s, color .15s;
}

.step_btn.is_active {
  border-color: rgba(255,255,255,.8);
  background: rgba(255,255,255,.22);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,.2);
}

/* ── Card body ─────────────────────────────────────────────── */

.ticket_body { padding: 24px; }

.step_panel { display: none; }
.step_panel.is_active { display: block; }

.panel_title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--c-muted);
  margin-bottom: 18px;
}

/* ── Fields ────────────────────────────────────────────────── */

.field { margin-bottom: 16px; }

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 7px;
  -webkit-user-select: none;
  user-select: none;
}

input,
select {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--c-border);
  border-radius: 8px;
  background: #fafbfc;
  color: var(--c-text);
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-user-select: text;
  user-select: text;
}

input:focus,
select:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(17,116,173,.1);
  background: #fff;
}

input.invalid,
select.invalid { border-color: var(--c-error); }

.help {
  margin-top: 6px;
  font-size: 12px;
  color: var(--c-muted);
}

.error {
  margin-top: 6px;
  min-height: 14px;
  font-size: 12px;
  color: var(--c-error);
  font-weight: 500;
}

/* ── Actions ───────────────────────────────────────────────── */

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.btn {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: background .12s, border-color .12s;
  text-align: center;
  display: block;
  box-sizing: border-box;
  text-decoration: none;
}

.btn:hover { background: #f0f3f7; }

.btn.primary {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #fff;
}

.btn.primary:hover { background: #0e6497; border-color: #0e6497; }

/* ── Grid ──────────────────────────────────────────────────── */

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ── Prize section ─────────────────────────────────────────── */

.row_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chip {
  border: 1.5px solid var(--c-accent);
  background: #edf5fd;
  color: var(--c-accent);
  padding: 7px 12px;
  border-radius: 8px;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background .12s;
}

.chip:hover { background: #d7ebf9; }

.prize_list {
  margin-top: 12px;
  border-radius: 8px;
  border: 1px solid var(--c-border);
  background: #fafbfc;
  padding: 10px;
  min-height: 48px;
}

.prize_row {
  display: grid;
  grid-template-columns: 1fr 80px;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.prize_row:last-child { margin-bottom: 0; }

.prize_title {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
}

.prize_meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--c-muted);
}

.prize_right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.mini {
  border: 1.5px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-error);
  border-radius: 6px;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background .12s;
}

.mini:hover { background: #fdf2f2; border-color: var(--c-error); }

.meta_line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--c-muted);
}

.error_inline { color: var(--c-error); font-weight: 600; }

/* ── Preview ───────────────────────────────────────────────── */

.preview .p_ticket {
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--c-border);
  background: #fafbfc;
  margin-bottom: 12px;
}

.preview .p_title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--c-muted);
  margin-bottom: 10px;
}

.preview .p_row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--c-border);
}

.preview .p_row:first-of-type { border-top: 0; }

.preview .p_l {
  font-size: 13px;
  color: var(--c-muted);
}

.preview .p_r {
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  color: var(--c-text);
}

.preview .p_empty {
  font-size: 13px;
  color: var(--c-muted);
  padding: 8px 0;
}

/* ── Prize modal ───────────────────────────────────────────── */

.modal.is_hidden { display: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  touch-action: none;
}

.modal_backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10,20,35,.55);
  backdrop-filter: blur(3px);
}

.modal_box {
  position: relative;
  width: min(480px, 92vw);
  margin: 10vh auto 0;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.modal_title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--c-primary);
}

/* ── Result dialog ─────────────────────────────────────────── */

dialog {
  border: none;
  border-radius: var(--r-lg);
  padding: 24px;
  max-width: 420px;
  width: calc(100% - 32px);
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  position: fixed;
  inset: 0;
  margin: auto;
  z-index: 10000;
}

dialog::backdrop { background: rgba(10,20,35,.55); backdrop-filter: blur(3px); }
dialog:not([open]) { display: none; }

dialog strong { display: block; font-size: 17px; margin-bottom: 8px; color: var(--c-primary); }
dialog div    { font-size: 14px; color: var(--c-muted); line-height: 1.5; }

dialog button {
  margin-top: 18px;
  padding: 11px 20px;
  border: 0;
  border-radius: 8px;
  background: var(--c-accent);
  color: #fff;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s;
}

dialog button:hover { background: #0e6497; }

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .actions { grid-template-columns: 1fr; }
  .ticket_head { padding: 18px 16px 14px; }
  .ticket_body { padding: 18px 16px; }
}

/* ── Premieforslag ─────────────────────────────────────────── */

.suggest_label {
  font-size: 12px;
  color: var(--c-muted);
  margin: 4px 0 6px;
}

.prize_suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.suggest_chip {
  border: 1px solid var(--c-border);
  background: #f7fafc;
  color: var(--c-primary);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.suggest_chip:hover  { background: #eef4f9; border-color: var(--c-accent); }
.suggest_chip:active { transform: scale(.96); }
.suggest_chip::before { content: "+ "; color: var(--c-accent); font-weight: 700; }

/* ── Vinnersjanse-guide ────────────────────────────────────── */

.winchance {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  background: #fafbfc;
}

.winchance_bar {
  height: 8px;
  border-radius: 999px;
  background: #e7edf2;
  overflow: hidden;
}

.winchance_fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width .25s ease, background .25s ease;
  background: #c0392b;
}

.winchance_text {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--c-muted);
}

.winchance.wc_good .winchance_fill { background: #27ae60; }
.winchance.wc_good { border-color: #b8e3c6; background: #f2fbf5; }
.winchance.wc_good .winchance_text { color: #1b7a42; }

.winchance.wc_ok .winchance_fill { background: #e0a106; }
.winchance.wc_ok { border-color: #f0e0b0; background: #fdf9ec; }
.winchance.wc_ok .winchance_text { color: #8a6d08; }

.winchance.wc_bad .winchance_fill { background: #c0392b; }
.winchance.wc_bad { border-color: #f0c9c4; background: #fdf3f2; }
.winchance.wc_bad .winchance_text { color: #a5281b; }

/* ── Filopplasting (dropzone) ──────────────────────────────── */

.dropzone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 130px;
  padding: 18px;
  border: 2px dashed var(--c-border);
  border-radius: var(--r-md);
  background: #fafbfc;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.dropzone:hover     { border-color: var(--c-accent); background: #f3f8fc; }
.dropzone.is_drag   { border-color: var(--c-accent); background: #e9f3fb; }
.dropzone.has_file  { border-style: solid; padding: 10px; }

.dropzone_inner   { pointer-events: none; }
.dropzone_icon    { font-size: 26px; color: var(--c-accent); line-height: 1; margin-bottom: 8px; }
.dropzone_text    { font-size: 13.5px; color: var(--c-text); }
.dropzone_link    { color: var(--c-accent); font-weight: 600; text-decoration: underline; }
.dropzone_hint    { font-size: 11.5px; color: var(--c-muted); margin-top: 5px; }

.dropzone_preview {
  max-height: 120px;
  max-width: 100%;
  border-radius: 8px;
  object-fit: contain;
}

.dropzone_clear {
  position: absolute;
  top: 6px; right: 6px;
  width: 26px; height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dropzone_clear:hover { background: rgba(0,0,0,.75); }
