/* ---------------------------------------------------------
   US Visa Approval Predictor — visual system
   Palette: ink navy / deep navy / parchment / visa gold
--------------------------------------------------------- */

:root {
  --navy: #0e2a47;
  --navy-deep: #081c30;
  --parchment: #f6f1e4;
  --parchment-line: #e4dbc4;
  --gold: #c9a227;
  --gold-soft: #e7d8a6;
  --ink: #1b2430;
  --ink-soft: #5a6270;
  --approved: #1f7a54;
  --approved-soft: #e5f3ec;
  --denied: #b23b2e;
  --denied-soft: #fbeae7;
  --radius-doc: 4px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background: var(--parchment);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
}

h1, h2, .brand-title, .step-title, .preview-title, .stamp-line-1 {
  font-family: "Fraunces", Georgia, serif;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--navy-deep);
  color: var(--parchment);
  padding: 28px 0;
  border-bottom: 4px solid var(--gold);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  font-size: 34px;
  transform: rotate(-8deg);
  display: inline-block;
}

.brand-eyebrow {
  margin: 0 0 2px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--gold-soft);
}

.brand-title {
  margin: 0;
  font-size: 26px;
  font-weight: 500;
  color: #fff;
}

.page-body {
  padding: 40px 24px 80px;
}

/* ---------- Stamp result panel ---------- */

.stamp-panel {
  border: 2px solid var(--ink);
  border-radius: var(--radius-doc);
  background: #fff;
  padding: 28px 32px;
  margin-bottom: 36px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  animation: stampIn 0.5s cubic-bezier(.2,.9,.3,1.2);
}

@keyframes stampIn {
  0% { transform: scale(0.85) rotate(-6deg); opacity: 0; }
  60% { transform: scale(1.04) rotate(-2deg); opacity: 1; }
  100% { transform: scale(1) rotate(-2deg); opacity: 1; }
}

.stamp-mark {
  border: 3px solid currentColor;
  border-radius: 8px;
  padding: 10px 20px;
  text-align: center;
  transform: rotate(-2deg);
  flex-shrink: 0;
}

.stamp-line-1 {
  display: block;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.stamp-line-2 {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}

.stamp-approved { color: var(--approved); background: var(--approved-soft); }
.stamp-denied { color: var(--denied); background: var(--denied-soft); }

.stamp-detail {
  flex: 1;
  min-width: 220px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
}

/* ---------- Workspace layout ---------- */

.workspace {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 860px) {
  .workspace { grid-template-columns: 1fr; }
}

/* ---------- Form card ---------- */

.form-card {
  background: #fff;
  border: 1px solid var(--parchment-line);
  border-radius: var(--radius-doc);
  padding: 32px;
  position: relative;
}

.form-card::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  bottom: 14px;
  border: 1px solid var(--parchment-line);
  pointer-events: none;
}

/* Checkpoints tracker */

.checkpoints {
  list-style: none;
  display: flex;
  padding: 0;
  margin: 0 0 32px;
  position: relative;
}

.checkpoints::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 30px;
  right: 30px;
  height: 2px;
  background: var(--parchment-line);
  z-index: 0;
}

.checkpoint {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
  cursor: default;
}

.checkpoint-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--parchment-line);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.25s ease;
}

.checkpoint-label {
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.checkpoint.is-done .checkpoint-dot {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
  cursor: pointer;
}

.checkpoint.is-active .checkpoint-dot {
  border-color: var(--navy);
  color: var(--navy);
  box-shadow: 0 0 0 4px rgba(14, 42, 71, 0.08);
}

.checkpoint.is-active .checkpoint-label {
  color: var(--navy);
  font-weight: 600;
}

/* Steps */

.step {
  display: none;
  border: none;
  margin: 0;
  padding: 0;
}

.step.is-active { display: block; animation: fadeStep 0.3s ease; }

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

.step.shake { animation: shake 0.35s; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.step-title {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 500;
  color: var(--navy);
}

.step-hint {
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-size: 14px;
}

.field { margin-bottom: 22px; }

.field label,
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

.select-control {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--parchment-line);
  border-radius: var(--radius-doc);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a6270' stroke-width='1.6' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: border-color 0.2s ease;
}

.select-control:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(14, 42, 71, 0.12);
}

/* Range sliders */

.range-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.range-readout {
  font-family: "Fraunces", serif;
  font-size: 16px;
  color: var(--navy);
  font-weight: 600;
}

.range-control {
  width: 100%;
  margin-top: 10px;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--parchment-line);
  border-radius: 2px;
  outline: none;
}

.range-control::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid var(--navy);
  cursor: pointer;
  margin-top: -8px;
}

.range-control::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid var(--navy);
  cursor: pointer;
}

.range-control::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: var(--parchment-line);
}

/* Toggle pills */

.toggle-pair {
  display: inline-flex;
  border: 1.5px solid var(--parchment-line);
  border-radius: 999px;
  overflow: hidden;
  width: fit-content;
}

.toggle-pair input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-pill {
  padding: 9px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-pair input[type="radio"]:checked + .toggle-pill {
  background: var(--navy);
  color: #fff;
}

.toggle-pair input[type="radio"]:focus-visible + .toggle-pill {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

/* Buttons */

.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px dashed var(--parchment-line);
}

.primary-btn {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 12px 26px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-doc);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.primary-btn:hover { background: #123354; }
.primary-btn:active { transform: scale(0.98); }

.primary-btn.is-submit {
  background: var(--gold);
  color: var(--navy-deep);
  display: none;
}

.primary-btn.is-submit:hover { background: #b8931f; }

.ghost-btn {
  background: transparent;
  border: 1.5px solid var(--parchment-line);
  color: var(--ink-soft);
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-doc);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.ghost-btn:hover:not(:disabled) {
  border-color: var(--navy);
  color: var(--navy);
}

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

/* ---------- Preview card (boarding-pass style) ---------- */

.preview-card {
  background: var(--navy-deep);
  color: var(--parchment);
  border-radius: var(--radius-doc);
  padding: 28px 28px 24px;
  position: sticky;
  top: 24px;
  border: 1px solid var(--navy);
}

.preview-perforation {
  height: 0;
  border-top: 2px dashed rgba(246, 241, 228, 0.18);
  margin-bottom: 20px;
}

.preview-eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--gold-soft);
}

.preview-title {
  margin: 0 0 20px;
  font-size: 20px;
  font-weight: 500;
  color: #fff;
}

.preview-rows { margin: 0; }

.preview-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(246, 241, 228, 0.1);
  font-size: 13.5px;
}

.preview-row dt {
  color: rgba(246, 241, 228, 0.6);
}

.preview-row dd {
  margin: 0;
  font-weight: 600;
  color: #fff;
  text-align: right;
}

.preview-barcode {
  margin-top: 24px;
  height: 34px;
  background: repeating-linear-gradient(
    90deg,
    rgba(246, 241, 228, 0.9) 0px,
    rgba(246, 241, 228, 0.9) 2px,
    transparent 2px,
    transparent 5px,
    rgba(246, 241, 228, 0.9) 5px,
    rgba(246, 241, 228, 0.9) 6px,
    transparent 6px,
    transparent 10px
  );
  opacity: 0.7;
  border-radius: 2px;
}

/* ---------- Accessibility & motion ---------- */

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .stamp-panel, .step.is-active { animation: none; }
}

@media (max-width: 480px) {
  .brand-title { font-size: 20px; }
  .form-card, .preview-card { padding: 22px; }
  .stamp-panel { padding: 20px; }
}