/* Ko Te Šiša — web pretplata. Mobile-first: bazna širina 360px, na većim ekranima centrirana kolona do 480px.
   Boje preuzete iz Flutter aplikacije (reserve_saloon/lib/core/theme/app_colors.dart): tamna pozadina + kraljevska zlatna.
   Zlatni sjaj se koristi samo na glavnom dugmetu i na izabranoj opciji trajanja. */

:root {
  --bg: #0D1117;
  --bg-2: #0F1420;
  --card: #161B27;
  --card-hi: #1E2433;
  --field: #1A2030;
  --border: #28303D;

  --gold: #D4A017;
  --gold-rich: #E0B23C;
  --gold-light: #F2CF66;
  --gold-glow: #FFD978;
  --gold-dark: #8A5A00;
  --gold-dim: #3A2B0F;
  --gold-muted: #241C0D;
  --gold-border: #9F720D;
  --on-gold: #15120B;

  --text: #F3F0E8;
  --muted: #A29C8E;
  --success: #3AAD6E;
  --error: #E05252;
  --error-bg: #2A1618;

  --glow: 0 0 0 1px rgba(212, 160, 23, .55), 0 6px 20px rgba(212, 160, 23, .28);

  /* Sistemski fontovi: CSP stranice ne dozvoljava vanjske fontove. Serif za naziv i naslove. */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;

  --gutter: 16px;
  --radius: 14px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  background-image: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

[hidden] { display: none !important; }

h1, h2 { font-family: var(--font-display); font-weight: 600; margin: 0; text-wrap: balance; }
h1 { font-size: 1.75rem; line-height: 1.2; }
h2 { font-size: 1.25rem; line-height: 1.3; }
h3 { font-size: 1.0625rem; margin: 0; }
p { margin: 0; }

a { color: var(--gold-light); text-underline-offset: 3px; }
a:hover { color: var(--gold-glow); }

:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- okvir stranice ---------- */

.page {
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
  padding-block: 20px 8px;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.wordmark span { color: var(--gold); margin-left: .25em; }

.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.lead { color: var(--muted); }

/* ---------- kartice ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 0;
}

.status {
  display: flex;
  align-items: center;
  gap: 14px;
}
.status__icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--gold-muted);
  border: 1px solid var(--gold-border);
  color: var(--gold-light);
}
.status__icon svg { width: 24px; height: 24px; }
.status--free .status__icon { background: var(--field); border-color: var(--border); color: var(--muted); }
.status__text { min-width: 0; font-weight: 500; }
.status__text strong { color: var(--gold-light); font-weight: 700; }

.note { color: var(--muted); font-size: .9375rem; }

.card--auto { border-color: var(--gold-border); background: var(--gold-muted); }

/* ---------- forma ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .9375rem; font-weight: 600; }

.input-wrap { position: relative; display: flex; }

.input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  background: var(--field);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  font-size: 1rem; /* min 16px: iOS ne zumira polje pri fokusu */
}
.input::placeholder { color: #6F6A60; }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 160, 23, .3); }
.input[aria-invalid="true"] { border-color: var(--error); }
.input-wrap .input { padding-right: 96px; }

.toggle-pw {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 48px;
  min-width: 48px;
  padding: 0 12px;
  background: transparent;
  border: 0;
  color: var(--gold-light);
  font: inherit;
  font-size: .9375rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
}

.error {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 12px 14px;
  background: var(--error-bg);
  border: 1px solid var(--error);
  border-radius: 12px;
  color: #FFD9D9;
  font-size: .9375rem;
}
.error::before { content: "!"; flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--error); color: #fff; font-weight: 700; font-size: .8125rem; display: grid; place-items: center; margin-top: 1px; }

.info {
  padding: 12px 14px;
  background: var(--gold-muted);
  border: 1px solid var(--gold-dim);
  border-radius: 12px;
  color: var(--gold-light);
  font-size: .9375rem;
}

/* ---------- dugmad ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 12px 20px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  color: var(--on-gold);
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  box-shadow: var(--glow);
}
.btn:hover { color: var(--on-gold); filter: brightness(1.05); }
.btn:disabled, .btn[aria-busy="true"] { cursor: default; filter: saturate(.7) brightness(.85); box-shadow: none; }

.btn--ghost {
  background: transparent;
  color: var(--gold-light);
  border: 1px solid var(--gold-border);
  box-shadow: none;
}
.btn--ghost:hover { color: var(--gold-glow); filter: none; background: var(--gold-muted); }

.brand h1 { flex: 1 1 auto; min-width: 0; }

.link-btn {
  flex: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 4px;
  background: none;
  border: 0;
  font: inherit;
  font-size: .9375rem;
  color: var(--gold-light);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid rgba(21, 18, 11, .3);
  border-top-color: var(--on-gold);
  animation: spin .8s linear infinite;
  flex: none;
}
.spinner--lg { width: 44px; height: 44px; border-width: 4px; border-color: var(--gold-dim); border-top-color: var(--gold); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* ---------- izbor trajanja ---------- */

.options { display: flex; flex-direction: column; gap: 10px; border: 0; padding: 0; margin: 0; min-width: 0; }
.options legend { padding: 0; margin-bottom: 10px; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }

.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  min-width: 0;
}
.option__input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.option__radio {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  display: grid;
  place-items: center;
}
.option__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.option__title { font-weight: 600; }
.option__save { font-size: .875rem; color: var(--success); font-weight: 600; }
.option__price { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge {
  align-self: flex-start;
  margin-bottom: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  color: var(--gold-glow);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.option:has(.option__input:checked) {
  border-color: var(--gold);
  background: var(--gold-muted);
  box-shadow: var(--glow);
}
.option:has(.option__input:checked) .option__radio { border-color: var(--gold); }
.option:has(.option__input:checked) .option__radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.option:has(.option__input:focus-visible) { outline: 3px solid var(--gold-light); outline-offset: 2px; }

/* ---------- glavna akcija (u normalnom toku stranice, ispod izbora trajanja) ---------- */

.action-bar {
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.secure-note { font-size: .875rem; color: var(--muted); text-align: center; }
.brands { color: var(--text); font-weight: 600; }

/* ---------- rezultat (uspjeh / otkazano / greska) ---------- */

.result { align-items: center; text-align: center; padding-block: 28px; }
.result__icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gold-muted);
  border: 2px solid var(--gold-border);
  color: var(--gold-light);
}
.result__icon svg { width: 36px; height: 36px; }
.result__icon--ok { border-color: var(--success); color: var(--success); background: #12261B; }
.result__icon--bad { border-color: var(--error); color: var(--error); background: var(--error-bg); }

/* ---------- uslovi ---------- */

.legal { display: flex; flex-direction: column; gap: 20px; }
.legal section { display: flex; flex-direction: column; gap: 8px; }
.legal h2 { font-size: 1.125rem; }
.legal p { color: #D9D4C7; }

/* ---------- footer ---------- */

.site-footer {
  flex: none;
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
  padding-block: 16px calc(20px + env(safe-area-inset-bottom, 0px));
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: .875rem;
  color: var(--muted);
}
.site-footer a { display: inline-flex; align-items: center; min-height: 48px; }

/* ---------- veći ekrani ---------- */

@media (min-width: 768px) {
  .page { padding-block: 40px 16px; gap: 24px; }
  h1 { font-size: 2rem; }
  .card { padding: 20px; }
}

@media (max-width: 360px) {
  .btn { font-size: 1rem; padding-inline: 12px; }
}

@media (max-width: 340px) {
  h1 { font-size: 1.5rem; }
  .option { padding-inline: 10px; gap: 10px; }
  .option__price { font-size: .9375rem; }
}

/* ---------- pregled planova ---------- */

.overview { display: flex; flex-direction: column; gap: 12px; }
.overview h2 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.plan-block { display: flex; flex-direction: column; gap: 8px; }
.plan-block--gold { border-color: var(--gold-border); background: var(--gold-muted); }
.plan-block__title { font-weight: 700; font-size: 1.0625rem; }
.plan-block__hl { font-weight: 700; color: var(--gold-light); }
.plan-block__list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
