:root {
  --pine: #12251e;
  --pine-2: #1f3d30;
  --fog: #e6ece7;
  --paper: #f8faf7;
  --river: #2e6f73;
  --saffron: #e3a33b;
  --ink: #16231d;
  --muted: #506258;
  --line: #c3cfc7;
  --err: #b9432e;
  --radius: 12px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fog);
  color: var(--ink);
  font-family: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}

/* Hero */
.hero {
  position: relative;
  background: var(--pine);
  color: #f3f6f2;
  min-height: 21rem;
  overflow: hidden;
}

.flags {
  display: block;
  width: 100%;
  height: 8.5rem;
}

.flag {
  transform-box: fill-box;
  transform-origin: 50% 0;
  animation: sway 5.5s ease-in-out infinite alternate;
}

@keyframes sway {
  from { transform: rotate(-3deg); }
  to   { transform: rotate(3deg); }
}

.hero-text {
  position: relative;
  z-index: 2;
  padding: 0.5rem 1.4rem 6rem;
  max-width: 40rem;
  margin: 0 auto;
}

h1, h2 {
  font-family: "Rozha One", Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.1;
  margin: 0;
}

h1 { font-size: clamp(2.5rem, 10vw, 4.4rem); }

.tagline {
  margin: 0.7rem 0 0;
  font-size: 1.15rem;
  color: #c9d8cf;
}

.peaks {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 7rem;
  z-index: 1;
}

.peak-back { fill: var(--pine-2); }
.peak-front { fill: var(--fog); }

/* Form sheet */
.sheet {
  max-width: 40rem;
  margin: -1.5rem auto 0;
  padding: 0 1rem 2rem;
  position: relative;
  z-index: 3;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem 1.6rem;
}

h2 { font-size: 1.9rem; color: var(--pine); }

.intro { color: var(--muted); margin: 0.6rem 0 1.4rem; max-width: 34rem; }

.field { margin: 0 0 1.35rem; padding: 0; border: 0; }

label, legend {
  display: block;
  font-weight: 700;
  margin-bottom: 0.4rem;
  padding: 0;
}

input[type="text"],
input[type="tel"],
input[type="number"],
select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  min-height: 3rem;
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
.file-input:focus-visible ~ .drop {
  outline: 3px solid var(--river);
  outline-offset: 2px;
}

.invalid { border-color: var(--err) !important; }

.hint { margin: 0.4rem 0 0; font-size: 0.9rem; color: var(--muted); }

.phone-row { display: flex; gap: 0.5rem; }
.phone-row select { width: 9.5rem; flex: none; }
.phone-row input { flex: 1; min-width: 0; }

/* Indian or Foreigner tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.tiles input { position: absolute; opacity: 0; pointer-events: none; }
.tiles label {
  margin: 0;
  text-align: center;
  padding: 0.85rem 0.5rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-weight: 500;
}
.tiles input:checked + label {
  background: var(--pine);
  border-color: var(--pine);
  color: #fff;
  font-weight: 700;
}
.tiles input:focus-visible + label { outline: 3px solid var(--river); outline-offset: 2px; }

/* Upload */
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

.drop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 5rem;
  margin: 0;
  padding: 1rem;
  border: 2px dashed var(--river);
  border-radius: 10px;
  background: #eef4f1;
  color: var(--river);
  text-align: center;
  cursor: pointer;
}

.preview { display: flex; gap: 0.8rem; align-items: center; margin-top: 0.7rem; }
.preview img { width: 5.5rem; height: 4rem; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.preview p { margin: 0; font-size: 0.9rem; color: var(--muted); }

/* Stepper */
.stepper { display: flex; align-items: stretch; gap: 0.5rem; max-width: 12rem; }
.stepper button {
  flex: none;
  width: 3rem;
  font: inherit;
  font-size: 1.4rem;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  color: var(--pine);
}
.stepper input { text-align: center; padding-left: 0.3rem; padding-right: 0.3rem; }
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input { -moz-appearance: textfield; appearance: textfield; }

/* Consent */
.consent { display: flex; gap: 0.7rem; align-items: flex-start; margin: 0 0 1.2rem; }
.consent input { width: 1.4rem; height: 1.4rem; margin-top: 0.15rem; flex: none; accent-color: var(--pine); }
.consent label { margin: 0; font-weight: 400; }

.error {
  margin: 0 0 1rem;
  padding: 0.7rem 0.85rem;
  border-left: 4px solid var(--err);
  background: #fbefec;
  color: #7c2a1a;
  border-radius: 6px;
}

.submit {
  width: 100%;
  min-height: 3.3rem;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--pine);
  background: var(--saffron);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.submit:disabled { opacity: 0.6; cursor: wait; }

.done p { max-width: 30rem; }
.again {
  margin-top: 0.6rem;
  font: inherit;
  color: var(--river);
  background: none;
  border: 0;
  padding: 0.4rem 0;
  text-decoration: underline;
  cursor: pointer;
}

/* Honeypot, hidden from people */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.foot { text-align: center; color: var(--muted); font-size: 0.9rem; padding: 0.5rem 1rem 2.2rem; }
.foot p { margin: 0.1rem 0; }

.noscript { text-align: center; color: var(--err); padding: 1rem; }

[hidden] { display: none !important; }

@media (min-width: 640px) {
  .card { padding: 2rem 2.2rem 2.2rem; }
  .hero { min-height: 24rem; }
  .flags { height: 10rem; }
}

@media (prefers-reduced-motion: reduce) {
  .flag { animation: none; }
}

/* Phone first refinements */
.lbl { display: block; font-weight: 700; margin-bottom: 0.4rem; }

body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }

.hero { min-height: 17.5rem; }
.flags { height: 7rem; }
.hero-text { padding-bottom: 5rem; }

input[type="text"], input[type="tel"], input[type="number"], select {
  font-size: 16px;
  min-height: 3.2rem;
}

.photo-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.photo-btns .drop { min-height: 4.4rem; padding: 0.6rem; font-weight: 700; }
.photo-btns .drop.invalid { border-color: var(--err); background: #fbefec; color: var(--err); }

.tiles label { padding: 1rem 0.5rem; }

.consent input { width: 1.6rem; height: 1.6rem; }

.submit-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 0 -1.25rem -1.6rem;
  padding: 0.9rem 1.25rem calc(0.9rem + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 72%, rgba(248, 250, 247, 0));
  border-radius: 0 0 var(--radius) var(--radius);
}
.submit { min-height: 3.5rem; }

@media (min-width: 640px) {
  .submit-bar { margin: 0 -2.2rem -2.2rem; padding-left: 2.2rem; padding-right: 2.2rem; }
  .hero { min-height: 22rem; }
  .flags { height: 9rem; }
}

/* Photo boxes for ID, passport and visa */
.hint-top { margin: -0.1rem 0 0.7rem; }

.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }

.slot { position: relative; }

.slot-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  aspect-ratio: 4 / 3;
  margin: 0;
  padding: 0.6rem;
  overflow: hidden;
  text-align: center;
  border: 2px dashed var(--river);
  border-radius: 10px;
  background: #eef4f1;
  color: var(--river);
  cursor: pointer;
  font-weight: 700;
}

.slot-title { position: relative; z-index: 2; font-size: 0.95rem; line-height: 1.25; }
.slot-state { position: relative; z-index: 2; font-size: 0.82rem; font-weight: 500; }

.slot-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  opacity: 0.35;
}

.slot.is-done .slot-tile { border-style: solid; border-color: var(--pine); color: var(--pine); background: #dfeae3; }
.slot.is-busy .slot-tile { opacity: 0.75; }
.slot.invalid .slot-tile { border-color: var(--err); background: #fbefec; color: var(--err); }

.file-input:focus-visible + .slot-tile { outline: 3px solid var(--river); outline-offset: 2px; }
