:root {
  --bg-1: #f8f6ef;
  --bg-2: #e6f6ff;
  --ink: #1c2331;
  --muted: #5b6475;
  --accent: #7a3cff;
  --accent-dark: #5b23d6;
  --card: #ffffff;
  --line: #d8dde8;
  --error: #c82f2f;
  --shadow: 0 18px 50px rgba(12, 25, 45, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 10%, rgba(122, 60, 255, 0.2), transparent 38%),
    radial-gradient(circle at 80% 12%, rgba(67, 140, 252, 0.2), transparent 38%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: min(900px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px;
  padding-bottom: 200px;
  position: relative;
  animation: rise 420ms ease both;
}

.card.is-loading > *:not(.loading-overlay) {
  opacity: 0.42;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.52);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  border-radius: 24px;
  z-index: 20;
}

.loading-overlay[hidden] {
  display: none !important;
}

.loading-overlay p {
  margin: 0;
  color: #2d3b52;
  font-weight: 700;
}

.loading-spinner {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid #dbe4f3;
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.12em;
  font-weight: 700;
}

h1 {
  margin: 10px 0 8px;
  font-size: clamp(1.6rem, 3.8vw, 2.3rem);
}

.subtext {
  margin: 0 0 20px;
  color: var(--muted);
}

.location-status {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 13px;
}

.location-status-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  border: 1px solid currentColor;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.location-status-copy {
  display: grid;
  gap: 4px;
}

.location-status-action {
  width: fit-content;
  min-height: 34px;
  margin-top: 4px;
  border: 1px solid currentColor;
  border-radius: 8px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.7);
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.location-status-action:hover,
.location-status-action:focus {
  background: #fff;
  outline: 2px solid rgba(122, 60, 255, 0.18);
}

.location-status[hidden] {
  display: none !important;
}

.location-status strong {
  color: var(--ink);
  font-size: 14px;
}

.location-status.is-open {
  border-color: #b7ddc0;
  background: #f1fbf3;
}

.location-status.is-closed,
.location-status.is-warning {
  border-color: #ead19b;
  background: #fff9eb;
}

.stepper {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.step {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--muted);
  background: #fff;
}

.step.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.line {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.step-panel {
  display: none;
  animation: fade 260ms ease;
}

.step-panel.is-active {
  display: block;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h2 {
  margin: 8px 0 16px;
  font-size: 1.25rem;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.option-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: center;
}

.option-card:has(input:checked) {
  border-color: var(--accent);
  background: rgba(122, 60, 255, 0.08);
}

.option-card.is-disabled {
  opacity: 0.42;
  cursor: not-allowed;
  background: #f4f5f7;
}

.option-card.is-disabled input,
.option-card.is-disabled span {
  cursor: not-allowed;
}

.option-card input {
  accent-color: var(--accent);
}

.option-text {
  font-weight: 700;
}

.option-badge {
  margin-left: auto;
  border: 1px solid #e6d8ff;
  border-radius: 999px;
  padding: 4px 8px;
  background: #f3ecff;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.esim-compatibility {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #e6d8ff;
  border-radius: 14px;
  background: #fbf8ff;
}

.esim-compatibility[hidden] {
  display: none !important;
}

.esim-compatibility h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--ink);
}

.esim-compatibility h4 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--ink);
}

.esim-compatibility p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.dial-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid #d8c8ff;
  border-radius: 8px;
  padding: 4px 10px;
  background: #fff;
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.dial-link:hover,
.dial-link:focus {
  background: #f3ecff;
  outline: 2px solid #e6d8ff;
}

.device-search {
  display: grid;
  gap: 8px;
}

.device-search label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.device-search input[type="search"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  background: #fff;
}

.device-search input[type="search"]:focus {
  outline: 2px solid #e6d8ff;
  border-color: var(--accent);
}

.device-model-results {
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.device-model-results[hidden],
.selected-device[hidden],
.compatibility-alert[hidden] {
  display: none !important;
}

.device-model-group + .device-model-group {
  border-top: 1px solid var(--line);
}

.device-model-brand {
  padding: 8px 12px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.device-model-option {
  width: 100%;
  min-height: 44px;
  border: 0;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.device-model-option:hover,
.device-model-option:focus {
  background: #f3ecff;
  outline: none;
}

.device-model-option small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.device-model-empty {
  padding: 12px;
  color: var(--muted);
  font-weight: 700;
}

.selected-device,
.compatibility-alert,
.eid-check,
.unlock-attestation {
  margin-top: 12px;
}

.selected-device {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid #d8eadf;
  border-radius: 10px;
  background: #f1fbf3;
}

.selected-device span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.compatibility-alert {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

.compatibility-alert.is-ok {
  border: 1px solid #b7ddc0;
  background: #f1fbf3;
  color: #246534;
}

.compatibility-alert.is-warning {
  border: 1px solid #ead19b;
  background: #fff9eb;
  color: #835f12;
}

.compatibility-options {
  display: grid;
  gap: 8px;
}

.compatibility-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.compatibility-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(122, 60, 255, 0.08);
}

.compatibility-option input {
  accent-color: var(--accent);
}

.unlock-attestation {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.unlock-attestation input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.hint {
  margin: 0 0 12px;
  color: var(--muted);
}

.plans-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* Skeleton shimmer */
.skel {
  background: linear-gradient(90deg, #eef0ee 25%, #e0e5e0 50%, #eef0ee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
}

.skel--text {
  display: block;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.plan-card--skeleton {
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

.plan-card--skeleton .plan-visual.skel {
  width: 104px;
  height: 104px;
  flex: 0 0 104px;
  border-radius: 14px;
}

.plan-card--skeleton .plan-main {
  gap: 12px;
}

.plan-card {
  position: relative;
  border: 1px solid #e7ebe9;
  border-radius: 18px;
  padding: 18px;
  display: flex;
  gap: 18px;
  align-items: center;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 32, 28, 0.04), 0 8px 24px rgba(16, 32, 28, 0.06);
}

.plan-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px #efe9ff, 0 2px 4px rgba(28, 16, 56, 0.08), 0 16px 40px rgba(91, 35, 214, 0.2);
}

.plan-badge {
  position: absolute;
  top: -10px;
  left: 16px;
  background: #fbf2dd;
  color: #b07d18;
  border: 1px solid #efe0bd;
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.plan-visual {
  width: 104px;
  height: 104px;
  border-radius: 14px;
  background: linear-gradient(160deg, #2d1561, #4c1fa8 55%, #7a3cff);
  color: #fff;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  flex: 0 0 104px;
}

.plan-visual-gb {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.plan-visual-gb span {
  font-size: 14px;
  font-weight: 700;
  margin-left: 2px;
}

.plan-visual-days {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 11px;
  font-weight: 600;
  opacity: 0.92;
}

.plan-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.plan-name {
  margin: 0;
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.plan-price {
  color: var(--ink);
  white-space: nowrap;
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
}

.plan-price-amount {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1;
}

.plan-price-currency {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-left: 2px;
}

.plan-variant {
  color: var(--muted);
  font-size: 0.92rem;
}

.plan-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.plan-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: #f1f4f3;
  border-radius: 999px;
  padding: 4px 10px;
}

.plan-tag.is-brand {
  color: #5b3aa0;
  background: #efe9fb;
}

.plan-per-day {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-dark);
}

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e7ebe9;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.qty-btn {
  width: 40px;
  height: 40px;
  border: 0;
  background: #fff;
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  border-right: 1px solid #e7ebe9;
}

.qty-btn:last-child {
  border-right: 0;
  border-left: 1px solid #e7ebe9;
}

.qty-btn:hover {
  background: #efe9ff;
}

.qty-value {
  min-width: 42px;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  height: 40px;
  line-height: 40px;
}

.footer-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 14px 20px;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.footer-actions-inner {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.footer-summary {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.footer-summary strong {
  display: block;
  font-size: 34px;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.1;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn.primary:hover {
  background: var(--accent-dark);
}

.btn.ghost {
  background: #f0f3f8;
  color: var(--ink);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
}

.btn-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.error {
  margin-top: 10px;
  color: var(--error);
}

.result {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  background: #fbfdff;
  text-align: center;
}

.result h2 {
  margin: 0 0 8px;
  font-size: 24px;
  color: var(--accent);
}

.result .order-number {
  font-size: 32px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.04em;
  margin: 20px 0;
  font-family: 'Courier New', monospace;
}

.result .barcode-wrap {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin: 20px 0;
  display: flex;
  justify-content: center;
}

.result canvas {
  max-width: 100%;
  height: auto;
}

.countdown {
  margin: 24px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.countdown-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.countdown-time {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
}

.countdown-sep {
  opacity: 0.45;
  animation: blink 1s step-start infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.countdown-sublabel {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.countdown-done {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
}

.result .pickup-msg {
  display: none;
}

.result-actions {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.service-info-details {
  margin-top: 20px;
  text-align: left;
}

.service-info-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.service-info-list div {
  display: grid;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.service-info-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.service-info-list dd {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}

.service-info-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.confirmation-mode .eyebrow,
.confirmation-mode h1,
.confirmation-mode .subtext,
.confirmation-mode .location-status,
.confirmation-mode .stepper,
.confirmation-mode .footer-actions,
.confirmation-mode #wizard-form {
  display: none !important;
}

.confirmation-mode .card {
  min-height: calc(100vh - 48px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.confirmation-mode .result {
  margin: 0;
  width: 100%;
  max-width: 620px;
}

@media (max-width: 760px) {
  .card {
    padding: 20px;
    border-radius: 16px;
  }

  .option-grid,
  .plans-grid {
    grid-template-columns: 1fr;
  }

  .plan-card {
    grid-template-columns: 84px 1fr;
    gap: 14px;
    align-items: flex-start;
    padding: 14px;
  }

  .plan-visual {
    width: 84px;
    height: 84px;
    flex-basis: 84px;
  }

  .plan-name {
    font-size: 20px;
  }

  .plan-price-amount {
    font-size: 24px;
  }

  .card {
    padding-bottom: 160px;
  }

  .confirmation-mode .card {
    min-height: calc(100vh - 24px);
    padding: 20px;
  }

  .footer-actions {
    flex-wrap: wrap;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 16px;
  }
}
