/* =====================================================================
   randka — style.css
   One stylesheet, no preprocessor, no framework. CSS custom properties
   drive the theme; a single reduced-motion media query handles a11y.
   ===================================================================== */

/* ─── Design tokens ─────────────────────────────────────────────────── */
:root {
  --bg-1: #ffe5ec;
  --bg-2: #ffc2d1;
  --bg-3: #fff0f5;
  --ink:  #2b2d42;
  --ink-soft: #4a4c63;
  --muted: #8a8ca8;
  --primary: #ff4d6d;
  --primary-deep: #c9184a;
  --accent: #ffb4a2;
  --gold: #d4a373;
  --card: #ffffff;
  --card-soft: #fff7f9;
  --shadow-1: 0 10px 40px rgba(201, 24, 74, 0.12);
  --shadow-2: 0 20px 60px rgba(201, 24, 74, 0.18);
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 180ms;
  --t-med: 320ms;
  --t-slow: 600ms;
  --font-serif: 'Playfair Display', 'Iowan Old Style', Georgia, serif;
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

/* Atrybut HTML `hidden` powinien zawsze wygrywać z `display: flex/grid`
   ustawionym na konkretnej klasie (np. .custom-city ma display: flex). */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 800px at 10% 0%, var(--bg-1) 0%, transparent 60%),
    radial-gradient(900px 700px at 100% 100%, var(--bg-2) 0%, transparent 55%),
    linear-gradient(135deg, var(--bg-3) 0%, var(--bg-1) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
}

button { font-family: inherit; }

/* ─── Background hearts ─────────────────────────────────────────────── */
.bg-hearts {
  position: fixed; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.heart-float {
  position: absolute;
  bottom: -40px;
  font-size: 22px;
  opacity: 0;
  animation: floatUp linear forwards;
  will-change: transform, opacity;
}
@keyframes floatUp {
  0%   { transform: translateY(0)        rotate(0deg)  scale(0.8); opacity: 0; }
  10%  { opacity: 0.55; }
  90%  { opacity: 0.45; }
  100% { transform: translateY(-110vh)   rotate(360deg) scale(1.2); opacity: 0; }
}

/* ─── Stage & step transitions ──────────────────────────────────────── */
.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
}

.step {
  width: 100%;
  max-width: 560px;
  text-align: center;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 44px 32px 36px;
  display: none;
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
.step.is-active {
  display: block;
  /* Defer to next frame so the transition actually plays. */
  animation: stepIn var(--t-slow) var(--ease) forwards;
}
.step.is-leaving {
  display: block;
  animation: stepOut var(--t-med) var(--ease) forwards;
}

@keyframes stepIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes stepOut {
  from { opacity: 1; transform: translateY(0)    scale(1); }
  to   { opacity: 0; transform: translateY(-14px) scale(0.98); }
}

/* ─── Typography ────────────────────────────────────────────────────── */
.kicker {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary-deep);
  margin: 0 0 14px;
  font-weight: 600;
}
.headline {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(28px, 5.4vw, 42px);
  line-height: 1.15;
  margin: 0 0 14px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.headline em {
  font-style: italic;
  background: linear-gradient(120deg, var(--primary) 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.subhead {
  font-size: 16px;
  color: var(--ink-soft);
  margin: 0 0 28px;
}
.muted { color: var(--muted); }
.microcopy {
  margin: 16px 0 0;
  min-height: 1.2em;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

/* ─── Buttons ───────────────────────────────────────────────────────── */
.actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  padding: 14px 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease),
              opacity var(--t-fast) var(--ease);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-yes {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(201, 24, 74, 0.35);
  animation: pulse 2.4s ease-in-out infinite;
}
.btn-yes:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 14px 30px rgba(201, 24, 74, 0.45);
}
.btn-yes:active { transform: translateY(0) scale(0.99); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 10px 24px rgba(201, 24, 74, 0.35); }
  50%      { box-shadow: 0 10px 30px rgba(201, 24, 74, 0.55), 0 0 0 12px rgba(255, 77, 109, 0.08); }
}

.btn-no {
  background: var(--card-soft);
  color: var(--ink-soft);
  border: 1px solid rgba(43, 45, 66, 0.08);
  transform-origin: center center;
  transition: transform var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease),
              opacity 400ms var(--ease);
}
.btn-no.is-gone {
  opacity: 0;
  transform: scale(0.55) rotate(18deg);
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(201, 24, 74, 0.3);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(201, 24, 74, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
}
.btn-ghost:hover { color: var(--ink); background: rgba(0,0,0,0.04); }

.btn-emoji { font-size: 18px; }

/* ─── Date / time picker ────────────────────────────────────────────── */
.picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}
.picker-label {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.picker-input {
  font: inherit;
  font-size: 18px;
  padding: 14px 18px;
  border: 2px solid rgba(201, 24, 74, 0.18);
  border-radius: var(--radius-sm);
  background: var(--card-soft);
  color: var(--ink);
  width: 100%;
  max-width: 320px;
  text-align: center;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
  color-scheme: light;
}
.picker-input:focus {
  outline: 0;
  border-color: var(--primary);
  background: #fff;
}
.picker-hint {
  margin: 14px 0 4px;
  font-size: 13px;
  color: var(--muted);
}
.quick-picks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.chip {
  appearance: none;
  border: 1px solid rgba(201, 24, 74, 0.25);
  background: #fff;
  color: var(--primary-deep);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.chip:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* ─── City cards ────────────────────────────────────────────────────── */
.cities {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 26px;
}
.city-card-custom {
  border: 2px dashed rgba(201, 24, 74, 0.32);
  background: rgba(255, 255, 255, 0.55);
}
.city-card-custom:hover {
  border-color: var(--primary);
  border-style: solid;
  background: #fff;
}
.city-card-custom.is-selected {
  border-style: solid;
}

/* Pole do wpisania własnego miasta — domyślnie ukryte, klasa .is-open
   dodawana przez JS po kliknięciu w kartę "Własne". */
.custom-city {
  margin: -10px 0 22px;
  display: none;            /* ukryte do momentu kliknięcia karty "Własne" */
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.custom-city.is-open {
  display: flex;            /* jawne nadpisanie domyślnego display:none */
  animation: stepIn 320ms var(--ease);
}
.custom-city input {
  font: inherit;
  font-size: 16px;
  padding: 12px 16px;
  border: 2px solid rgba(201, 24, 74, 0.2);
  border-radius: var(--radius-sm);
  background: var(--card-soft);
  color: var(--ink);
  width: 100%;
  max-width: 360px;
  text-align: center;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
  color-scheme: light;
}
.custom-city input:focus {
  outline: 0;
  border-color: var(--primary);
  background: #fff;
}
.custom-city input::placeholder {
  color: var(--muted);
  font-style: italic;
}
.city-card {
  appearance: none;
  border: 2px solid transparent;
  background: var(--card-soft);
  border-radius: var(--radius);
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
}
.city-card:hover {
  transform: translateY(-3px);
  background: #fff;
  box-shadow: var(--shadow-1);
}
.city-card.is-selected {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 10px 30px rgba(201, 24, 74, 0.18);
  transform: translateY(-2px);
}
.city-emoji { font-size: 36px; line-height: 1; }
.city-name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 22px;
  color: var(--ink);
}
.city-tag {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ─── Success screen ────────────────────────────────────────────────── */
.step-success { padding-bottom: 42px; }
.success-emoji {
  font-size: 64px;
  margin-bottom: 8px;
  animation: bounceIn 700ms var(--ease);
}
@keyframes bounceIn {
  0%   { transform: scale(0.4) rotate(-12deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(6deg); opacity: 1; }
  100% { transform: scale(1)    rotate(0); }
}
.success-msg {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 420px;
  margin: 8px auto 26px;
  line-height: 1.6;
}
.success-hint {
  font-size: 13px;
  color: var(--muted);
  margin: 22px 0 0;
}
.success-sign {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  color: var(--primary-deep);
  margin: 14px 0 0;
}

.countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cd-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 64px;
  padding: 12px 10px;
  background: linear-gradient(180deg, #fff 0%, var(--card-soft) 100%);
  border: 1px solid rgba(201, 24, 74, 0.12);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(201, 24, 74, 0.08);
}
.cd-num {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  color: var(--primary-deep);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cd-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}
.cd-sep {
  font-family: var(--font-serif);
  font-size: 28px;
  color: var(--primary);
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0.3; } }

/* ─── Overlay (No-click shim) ──────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(43, 45, 66, 0.45);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.overlay.is-open { display: flex; animation: fadeIn 200ms ease; }
.overlay-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px 28px 26px;
  text-align: center;
  max-width: 380px;
  box-shadow: var(--shadow-2);
  animation: popIn 320ms var(--ease);
}
.overlay-emoji { font-size: 52px; margin-bottom: 6px; }
.overlay-card h2 {
  font-family: var(--font-serif);
  margin: 0 0 8px;
  font-size: 22px;
}
.overlay-card p {
  margin: 0 0 18px;
  color: var(--ink-soft);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn  {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* ─── Honeypot (must stay visually hidden but reachable by bots) ──── */
.hp {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .cities { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .step { padding: 32px 22px 28px; }
  .headline { font-size: 30px; }
  .cities { grid-template-columns: 1fr; }
  .btn { padding: 13px 22px; }
  /* Countdown na bardzo wąskich ekranach: mniejsze bloki,
     2 w rzędzie zamiast łamania 3+1. */
  .countdown { gap: 6px; }
  .cd-block { min-width: 56px; padding: 10px 6px; }
  .cd-num   { font-size: 26px; }
  .cd-label { font-size: 10px; }
  .cd-sep   { font-size: 22px; }
}
@media (max-width: 380px) {
  /* iPhone SE i mniejsze — countdown jeszcze bardziej kompaktowy. */
  .cd-block { min-width: 48px; padding: 8px 4px; }
  .cd-num   { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
