/* ─── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Design Tokens ──────────────────────────────────────────────────────────── */
:root {
  --yellow:      #FEC83E;
  --bg:          #000000;
  --cell-bg:     #363636;
  --cell-border: #828282;
  --white:       #FFFFFF;
  --page-px:     clamp(16px, 5.6vw, 22px);
}

/* ─── Base ───────────────────────────────────────────────────────────────────── */
html { height: 100%; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: 'Manrope', sans-serif;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
}

/* ─── Page Container ─────────────────────────────────────────────────────────── */
.page {
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top:    44px;
  padding-left:   var(--page-px);
  padding-right:  var(--page-px);
  padding-bottom: clamp(130px, 33vw, 160px);
}

/* ─── Screens ────────────────────────────────────────────────────────────────── */
.screen { display: none; }
.screen.active { display: block; }

/* ─── Step Indicator ─────────────────────────────────────────────────────────── */
.steps { display: flex; gap: 9px; align-items: center; margin-bottom: 36px; }
.step {
  display: block; width: 12px; height: 12px; border-radius: 50%;
  background: var(--cell-bg); border: 0.5px solid var(--cell-border);
  flex-shrink: 0; transition: background 0.3s, border-color 0.3s;
}
.step--active, .step--done { background: var(--yellow); border-color: var(--yellow); }

/* ─── Title ──────────────────────────────────────────────────────────────────── */
.title {
  font-family: 'Anton', sans-serif; font-weight: 400;
  font-size: clamp(34px, 10.7vw, 42px); line-height: 1.2;
  color: var(--white); margin-bottom: clamp(10px, 2.5vw, 16px); letter-spacing: 0;
}
.title--accent { color: var(--yellow); }

/* ─── Description ────────────────────────────────────────────────────────────── */
.desc {
  font-size: clamp(13px, 3.97vw, 15.6px); line-height: 1.2;
  color: var(--white); font-weight: 400;
  max-width: 319px; margin-bottom: clamp(16px, 5vw, 24px);
}

/* ─── Profile Grid ───────────────────────────────────────────────────────────── */
.profile-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 5.8vw, 23px);
  margin-bottom: clamp(24px, 7vw, 36px);
}
.profile-btn {
  height: 38px; width: 100%;
  background: var(--cell-bg); border: 0.55px solid var(--cell-border);
  border-radius: 5px; color: var(--white);
  font-family: 'Manrope', sans-serif; font-weight: 600;
  font-size: clamp(10px, 3.3vw, 13px); letter-spacing: 0.6px;
  cursor: pointer; padding: 0 clamp(6px, 2vw, 10px);
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.profile-btn:hover { border-color: var(--yellow); background: rgba(254,200,62,0.08); }
.profile-btn:active { transform: scale(0.96); }
.profile-btn--selected {
  background: var(--yellow) !important; border-color: var(--yellow) !important;
  color: var(--cell-bg) !important; font-weight: 600;
}

/* ─── Time Slots ─────────────────────────────────────────────────────────────── */
.time-slots {
  display: flex; gap: clamp(6px, 2vw, 11px);
  margin-bottom: clamp(24px, 7vw, 36px); flex-wrap: nowrap;
}
.time-btn {
  flex: 1; height: 38px;
  background: var(--cell-bg); border: 0.5px solid var(--cell-border);
  border-radius: 5px; color: var(--white);
  font-family: 'Manrope', sans-serif; font-weight: 600;
  font-size: clamp(10px, 3.05vw, 12px); letter-spacing: 0.6px;
  cursor: pointer; transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap; -webkit-tap-highlight-color: transparent; touch-action: manipulation; padding: 0;
}
.time-btn:hover { border-color: var(--yellow); }
.time-btn:active { transform: scale(0.96); }
.time-btn--selected {
  background: var(--yellow) !important; border-color: var(--yellow) !important;
  color: var(--cell-bg) !important;
}

/* ─── Nav Buttons ────────────────────────────────────────────────────────────── */
.nav-buttons {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: clamp(10px, 2.5vw, 13px);
}
.btn-next {
  display: flex; align-items: center; justify-content: center;
  height: clamp(38px, 9.7vw, 44px); min-width: clamp(160px, 44vw, 180px);
  padding: 0 clamp(16px, 4vw, 20px);
  background: var(--yellow); border: 0.7px solid var(--yellow); border-radius: 21px;
  color: var(--cell-bg); font-family: 'Manrope', sans-serif; font-weight: 700;
  font-size: clamp(12px, 3.3vw, 14px); letter-spacing: 0.7px; cursor: pointer;
  white-space: nowrap; transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 3px 18px rgba(0,0,0,0.45);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  text-decoration: none;
}
.btn-next:disabled { opacity: 0.38; cursor: not-allowed; }
.btn-next:not(:disabled):hover { opacity: 0.88; transform: translateY(-1px); }
.btn-next:not(:disabled):active { transform: translateY(0) scale(0.97); }

.btn-prev {
  display: flex; align-items: center; justify-content: center;
  height: clamp(34px, 8.7vw, 38px); min-width: clamp(110px, 30vw, 130px);
  padding: 0 clamp(14px, 3.5vw, 18px);
  background: transparent; border: 0.7px solid var(--white); border-radius: 21px;
  color: var(--white); font-family: 'Manrope', sans-serif; font-weight: 700;
  font-size: clamp(12px, 3.3vw, 14px); letter-spacing: 0.7px; cursor: pointer;
  white-space: nowrap; transition: opacity 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn-prev:hover { opacity: 0.7; }
.btn-prev:active { transform: scale(0.97); }

/* ─── Result Card ────────────────────────────────────────────────────────────── */
.result-card {
  background: rgba(217,217,217,0.05); border: 1px solid rgba(255,255,255,0.72);
  border-radius: 10px; padding: clamp(16px, 5vw, 24px);
  margin-bottom: clamp(20px, 5vw, 28px);
}
.result-label {
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: rgba(255,255,255,0.45); margin-bottom: 6px;
}
.result-breakdown { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.result-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: rgba(255,255,255,0.6);
  padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.result-row:last-child { border-bottom: none; padding-bottom: 0; }
.result-row strong { color: var(--white); font-weight: 600; }
.result-icon { color: var(--yellow); font-size: 16px; margin-right: 8px; }

/* ─── Decorative Blob ────────────────────────────────────────────────────────── */
.deco-blob {
  position: fixed; bottom: -62px; right: -20px;
  width: 115vw; height: clamp(160px, 41vw, 185px);
  transform: rotate(-8deg); transform-origin: right bottom;
  pointer-events: none; z-index: 0; overflow: visible; opacity: 0.9;
}
.deco-blob svg, .deco-blob img { width: 100%; height: 100%; display: block; }
.deco-blob--left {
  right: unset; left: -20px; bottom: -56px;
  width: 148vw; transform-origin: left bottom;
}
.page > *:not(.deco-blob) { position: relative; z-index: 1; }

/* ─── Form Fields ────────────────────────────────────────────────────────────── */
.form-fields {
  display: flex; flex-direction: column;
  gap: clamp(10px, 2.5vw, 16px);
  margin-bottom: clamp(20px, 5vw, 28px);
}
.form-row--half { display: flex; gap: clamp(5px, 1.8vw, 7px); }
.form-row--half .field-input { flex: 1; min-width: 0; }
.field-input {
  width: 100%; height: 40px;
  background: #4a4a4a; border: 1px solid rgba(255,255,255,0.28); border-radius: 10px;
  color: var(--white); font-family: 'Manrope', sans-serif; font-weight: 400;
  font-size: clamp(12px, 4.1vw, 16px); letter-spacing: 0.8px;
  padding: 0 clamp(10px, 3vw, 12px); outline: none;
  transition: border-color 0.15s, background 0.15s;
  -webkit-appearance: none; appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.field-input::placeholder { color: rgba(255,255,255,0.48); font-weight: 400; }
.field-input:focus { border-color: var(--yellow); }
.field-input--full { width: 100%; }

/* ─── Phone Row ──────────────────────────────────────────────────────────────── */
.form-row--phone { display: flex; align-items: stretch; gap: clamp(4px, 1.3vw, 5px); }
.form-field--flag { flex: 0 0 clamp(72px, 20.4vw, 80px); position: relative; }
.field-input--phone { flex: 1; width: 100%; }
.flag-btn {
  width: 100%; height: 40px;
  background: #4a4a4a; border: 1px solid rgba(255,255,255,0.28); border-radius: 10px;
  color: var(--white); display: flex; align-items: center; justify-content: center;
  gap: 3px; cursor: pointer; padding: 0 6px;
  font-family: 'Manrope', sans-serif; font-size: clamp(10px, 3vw, 12px); font-weight: 600;
  letter-spacing: 0.4px; transition: border-color 0.15s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.flag-btn:hover, .flag-btn[aria-expanded="true"] { border-color: var(--yellow); }
.flag-emoji { font-size: clamp(14px, 4vw, 16px); line-height: 1; }
.flag-code { font-size: clamp(10px, 3vw, 12px); }
.flag-chevron { width: 8px; height: 5px; color: rgba(255,255,255,0.5); flex-shrink: 0; }
.flag-dropdown {
  display: none; position: absolute; top: calc(100% + 4px); left: 0;
  background: #2a2a2a; border: 1px solid rgba(255,255,255,0.18); border-radius: 10px;
  list-style: none; z-index: 100; min-width: 170px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.flag-dropdown.open { display: block; }
.flag-option {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; cursor: pointer;
  font-family: 'Manrope', sans-serif; font-size: 13px; color: var(--white);
  transition: background 0.12s;
}
.flag-option:hover, .flag-option--selected { background: rgba(254,200,62,0.12); }
.flag-option__flag { font-size: 16px; }
.flag-option__code { font-weight: 700; font-size: 12px; flex-shrink: 0; }
.flag-option__name { color: rgba(255,255,255,0.6); font-size: 12px; }

/* ─── Error Message ──────────────────────────────────────────────────────────── */
.form-error {
  color: #ff6b6b; font-size: 13px; font-weight: 600;
  margin-top: 8px; display: none;
}
.form-error.visible { display: block; }

/* ─── Tablet & Desktop ───────────────────────────────────────────────────────── */
@media (min-width: 481px) {
  body { align-items: center; min-height: 100dvh; padding: 40px 24px; background: #111; }
  .page {
    max-width: 500px; border-radius: 28px; height: auto; min-height: unset;
    padding-top: 52px; padding-left: clamp(28px, 7vw, 40px);
    padding-right: clamp(28px, 7vw, 40px); padding-bottom: 52px;
    box-shadow: 0 32px 96px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.06);
  }
  .deco-blob { display: none; }
  .steps { margin-bottom: 40px; }
  .title { font-size: 48px; margin-bottom: 14px; }
  .desc { font-size: 15px; max-width: 100%; margin-bottom: 24px; }
}
@media (min-width: 768px) {
  body { padding: 56px 32px; }
  .page { max-width: 540px; padding-top: 60px; padding-left: 48px; padding-right: 48px; padding-bottom: 60px; }
  .title { font-size: 54px; }
}
@media (min-width: 1024px) { .page { max-width: 560px; } }
@media (max-width: 359px) {
  .page { padding-top: 32px; padding-bottom: 24px; }
  .title { font-size: 28px; margin-bottom: 8px; }
  .steps { margin-bottom: 24px; }
}

:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
button:focus:not(:focus-visible) { outline: none; }
