:root {
  --red: #e31e24;
  --red-dark: #b41419;
  --ink: #2a1515;
  --muted: #6b3a3a;
  --line: rgba(180, 40, 40, 0.22);
  --panel: rgba(255, 248, 246, 0.55);
  --panel-solid: rgba(255, 245, 243, 0.92);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background: #9a1014;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  justify-content: center;
}

.stage {
  position: relative;
  width: min(100vw, 480px);
  aspect-ratio: 4500 / 8000;
  overflow: hidden;
  background: #c4181e;
}

.bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}

/* Form sits inside designed pink box: ~35.5%–70.5% Y, ~11%–89% X */
.form-slot {
  position: absolute;
  top: 35.6%;
  left: 11.5%;
  width: 77%;
  height: 34.2%;
  z-index: 2;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 2.2% 3.2% 2.8%;
  border-radius: 18px;
  background: transparent;
}

.form-slot::-webkit-scrollbar { width: 4px; }
.form-slot::-webkit-scrollbar-thumb {
  background: rgba(180, 40, 40, 0.35);
  border-radius: 4px;
}

.field { margin-bottom: 10px; }

.label {
  display: block;
  font-size: clamp(11px, 2.7vw, 13px);
  font-weight: 800;
  margin-bottom: 5px;
  color: var(--ink);
}

.req { color: var(--red); }

.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.role-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.role-grid label {
  margin: 0;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 9px 8px;
  text-align: center;
  font-size: clamp(12px, 3.2vw, 14px);
  font-weight: 800;
  cursor: pointer;
  background: var(--panel-solid);
  color: var(--ink);
}

.role-grid input:checked + label {
  border-color: var(--red);
  background: #fff;
  color: var(--red);
  box-shadow: inset 0 0 0 1px var(--red);
}

input[type="text"],
input[type="tel"],
input[type="search"] {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
  font-size: clamp(14px, 3.6vw, 16px);
  background: var(--panel-solid);
  color: var(--ink);
}

input:focus {
  outline: none;
  border-color: var(--red);
  background: #fff;
}

.company-list {
  margin-top: 6px;
  max-height: 120px;
  overflow-y: auto;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--panel-solid);
}

.company-list:empty { display: none; }

.company-option {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid rgba(180, 40, 40, 0.12);
  background: transparent;
  padding: 9px 11px;
  font-size: clamp(12px, 3.2vw, 14px);
  font-weight: 650;
  color: var(--ink);
  cursor: pointer;
}

.company-option:last-child { border-bottom: 0; }
.company-option:active,
.company-option.selected {
  background: #ffe8e8;
  color: var(--red);
}

.picked {
  margin-top: 6px;
  font-size: clamp(11px, 2.8vw, 13px);
  font-weight: 700;
  color: var(--red-dark);
}

.selfie-box {
  border: 1.5px dashed rgba(180, 40, 40, 0.45);
  border-radius: 12px;
  overflow: hidden;
  background: #1a1a1a;
  aspect-ratio: 1 / 1;
  max-height: 180px;
  width: min(100%, 180px);
  margin: 0 auto;
  position: relative;
}

#preview,
#video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  transform: scaleX(-1);
}

#preview.show,
#video.show { display: block; }

.selfie-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #bbb;
  font-size: clamp(11px, 2.8vw, 13px);
  text-align: center;
  padding: 12px;
}

.selfie-placeholder.hide { display: none; }

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: clamp(12px, 3.2vw, 14px);
  font-weight: 800;
  cursor: pointer;
}

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

.btn.ghost {
  background: var(--panel-solid);
  color: var(--ink);
  border: 1.5px solid var(--line);
}

.btn.primary {
  background: var(--red);
  color: #fff;
  margin-top: 8px;
}

.btn.primary:not(:disabled):active { background: var(--red-dark); }

.btn.full { width: 100%; margin-top: 6px; }

.hint {
  margin-top: 5px;
  font-size: clamp(10px, 2.5vw, 12px);
  color: var(--muted);
}

.msg {
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: clamp(11px, 2.8vw, 13px);
  display: none;
}

.msg.show { display: block; }
.msg.err { background: #ffe0e0; color: #8a1515; }
.msg.ok { background: #e5f6ea; color: #1b7a3d; }

.success-slot {
  position: absolute;
  top: 38%;
  left: 11.5%;
  width: 77%;
  z-index: 3;
}

.success-card {
  background: rgba(255, 248, 246, 0.95);
  border-radius: 16px;
  padding: 22px 16px;
  text-align: center;
  border: 1px solid var(--line);
}

.success-card .check {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1b7a3d;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 900;
  margin: 0 auto 10px;
}

.success-card h2 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.success-card p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 14px;
}

/* Short phones: allow page scroll instead of crushing artboard */
@media (max-height: 700px) {
  body {
    display: block;
    overflow-y: auto;
  }
  .stage {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    aspect-ratio: auto;
    height: auto;
  }
  .bg {
    position: relative;
    width: 100%;
    height: auto;
  }
  .form-slot {
    position: absolute;
    top: 35.6%;
    height: 34.2%;
  }
}
