/* FlagSTUDIO — standalone widget styles. No external dependencies. */

:root {
  --bg:        #0f1115;
  --panel:     #171a21;
  --panel-2:   #1e222b;
  --line:      #2a2f3a;
  --text:      #eef1f6;
  --muted:     #9aa3b2;
  --accent:    #6c5ce7;
  --accent-2:  #00d2b8;
  --danger:    #ff5d6c;
  --radius:    14px;
  --shadow:    0 10px 40px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -10%, #1b2030 0%, var(--bg) 60%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.stage {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

/* --- Brand ---------------------------------------------------------------- */
.brand { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.brand-mark {
  font-weight: 800; letter-spacing: .04em; font-size: 22px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub { color: var(--muted); font-size: 13px; }

/* --- Progress ------------------------------------------------------------- */
.progress { height: 6px; background: var(--panel); border-radius: 999px; overflow: hidden; margin-bottom: 22px; }
.progress-bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .35s cubic-bezier(.22,.61,.36,1);
}

/* --- Step cards ----------------------------------------------------------- */
.steps { position: relative; }
.step { display: none; animation: rise .35s ease both; }
.step.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.step h2 { font-size: 24px; line-height: 1.25; margin: 0 0 6px; }
.step .desc { color: var(--muted); margin: 0 0 22px; font-size: 15px; line-height: 1.5; }
.req-mark { color: var(--accent-2); font-weight: 700; }

/* Intro / success */
.hero { text-align: center; padding: 36px 10px; }
.hero h2 { font-size: 30px; }
.hero .emoji { font-size: 48px; display: block; margin-bottom: 10px; }

/* --- Generic inputs ------------------------------------------------------- */
.field { margin-bottom: 18px; }
.field > label.field-label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 14px; }
.field .sub { color: var(--muted); font-size: 12px; margin-top: 6px; }

input[type=text], input[type=email], input[type=tel], input[type=number], textarea, select {
  width: 100%; padding: 13px 14px; font-size: 15px; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  outline: none; transition: border-color .15s, box-shadow .15s; font-family: inherit;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,92,231,.25);
}
textarea { resize: vertical; min-height: 120px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }

/* --- Choice chips (radio / checkbox as buttons) --------------------------- */
.choices { display: grid; gap: 10px; }
.choices.cols-2 { grid-template-columns: 1fr 1fr; }
.choices.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 520px) { .choices.cols-2, .choices.cols-3 { grid-template-columns: 1fr; } }

.choice { position: relative; }
.choice input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; appearance: none; -webkit-appearance: none; }
.choice .box {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--panel); border: 1.5px solid var(--line); border-radius: 12px;
  cursor: pointer; transition: border-color .15s, background .15s, transform .05s;
  font-size: 15px; min-height: 52px;
}
.choice .box:hover { border-color: #3a4150; }
.choice input:checked + .box {
  border-color: var(--accent); background: linear-gradient(180deg, rgba(108,92,231,.16), rgba(108,92,231,.06));
}
.choice input:focus-visible + .box { box-shadow: 0 0 0 3px rgba(108,92,231,.3); }
.choice .swatch-dot { width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); flex: 0 0 auto; }
.choice .dc-dot { background: conic-gradient(from 0deg, #ff9a9e, #fecfef, #a18cd1, #84fab0, #ff9a9e); }

/* --- Image picker grid ---------------------------------------------------- */
.img-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.img-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 520px) { .img-grid, .img-grid.cols-3 { grid-template-columns: 1fr 1fr; } }

.img-card { position: relative; }
.img-card input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; appearance: none; -webkit-appearance: none; }
.img-card .inner {
  border: 0; border-radius: 12px; overflow: hidden; cursor: pointer;
  background: var(--panel); transition: box-shadow .15s, transform .05s; height: 100%;
}
.img-card .inner:hover { outline: 2px solid #3a4150; outline-offset: -2px; }
.img-card input:checked + .inner { outline: 3px solid var(--accent); outline-offset: -3px; }
.img-card .thumb {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: var(--panel-2);
}
.img-card .swatch-tile { width: 100%; aspect-ratio: 1 / 1; display: block; }
.img-card .cap { display: block; padding: 9px 10px; font-size: 13px; line-height: 1.25; text-align: center; }
.img-card .tick {
  position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; display: none; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.img-card input:checked ~ .tick { display: flex; }
.zoom-btn {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 8px;
  border: none; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.zoom-btn:hover { background: rgba(0,0,0,.8); }

/* --- File upload ---------------------------------------------------------- */
.file-drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 1.5px dashed var(--line); border-radius: 12px; padding: 28px 18px; text-align: center;
  cursor: pointer; transition: border-color .15s, background .15s; background: var(--panel);
}
.file-drop:hover, .file-drop.drag { border-color: var(--accent); background: rgba(108,92,231,.07); }
.file-drop .icon { font-size: 30px; }
.file-drop .files { margin-top: 10px; font-size: 13px; color: var(--accent-2); }
.file-drop input[type=file] { display: none; }

/* --- Verification panel (Jotform's embedded verify step) ------------------ */
.verify-panel { animation: rise .35s ease both; }
.verify-frame {
  width: 100%; min-height: 560px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; display: block;
}

/* --- Turnstile (proxy mode) ----------------------------------------------- */
.turnstile-box { margin-top: 4px; min-height: 65px; }
#captchaField.invalid .turnstile-box { outline: 2px solid var(--danger); outline-offset: 4px; border-radius: 6px; }
.submit-error { color: var(--danger); margin-top: 14px; font-size: 14px; line-height: 1.5; }
.submit-error[hidden] { display: none; }

/* --- Buttons / nav -------------------------------------------------------- */
.nav { display: flex; align-items: center; gap: 12px; margin-top: 28px; }
.nav-spacer { flex: 1; }
.btn {
  border: none; border-radius: 11px; padding: 13px 22px; font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: transform .05s, opacity .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(90deg, var(--accent), #8b7bff); color: #fff; }
.btn-primary:hover { filter: brightness(1.07); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn-ghost:hover { color: var(--text); border-color: #3a4150; }
.btn-ghost[hidden] { display: none; }

/* --- Validation ----------------------------------------------------------- */
.field-error { color: var(--danger); font-size: 13px; margin-top: 8px; display: none; }
.field.invalid .field-error { display: block; }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); }
.shake { animation: shake .35s; }
@keyframes shake { 0%,100%{transform:none} 20%,60%{transform:translateX(-6px)} 40%,80%{transform:translateX(6px)} }

/* --- Modal ---------------------------------------------------------------- */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.85); display: none; align-items: center;
  justify-content: center; z-index: 50; padding: 30px;
}
.modal.show { display: flex; }
.modal img { max-width: 90vw; max-height: 86vh; border-radius: 12px; }
.modal-close {
  position: absolute; top: 18px; right: 24px; background: none; border: none; color: #fff;
  font-size: 40px; line-height: 1; cursor: pointer;
}

/* --- Submit overlay ------------------------------------------------------- */
.btn.loading { position: relative; color: transparent; }
.btn.loading::after {
  content: ""; position: absolute; width: 18px; height: 18px; top: 50%; left: 50%;
  margin: -9px 0 0 -9px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
