/* Go Golan safety form — mobile-first, RTL-aware. No framework. */

:root {
  --bg: #f7f2e8;
  --surface: #ffffff;
  --primary: #2f5a2e;
  --primary-strong: #234721;
  --danger: #b23a3a;
  --muted: #5b5b5b;
  --border: #d7ceba;
  --focus: #4a8c48;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: #1a1a1a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Heebo", "Noto Sans Hebrew", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body[dir="rtl"] { direction: rtl; }
body[dir="ltr"] { direction: ltr; }

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 12px;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 12px;
  gap: 12px;
}

header.brand h1 {
  font-size: 20px;
  color: var(--primary-strong);
  margin: 0;
  line-height: 1.1;
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-titles { min-width: 0; }

.brand-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  flex: 0 0 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
}

.brand-logo::before { content: "G"; }

.capture-reassurance {
  background: #ecf2ea;
  border-inline-start: 4px solid var(--primary);
  padding: 8px 12px;
  border-radius: 6px;
  color: #233d20;
  font-size: 13px;
  margin: 0 0 10px;
}

@media (min-width: 1024px) {
  .container { max-width: 720px; }
}

.lang-toggle {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary-strong);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  min-height: 40px;
}

.step-indicator {
  font-size: 14px;
  color: var(--muted);
  margin: 6px 0 12px;
}

main.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  flex: 1;
}

h2 {
  font-size: 22px;
  color: var(--primary-strong);
  margin: 0 0 12px;
}

.per-license {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 12px;
}

/* Form inputs */
.field {
  margin-bottom: 14px;
  display: block;
}

.field label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 4px;
}

.field input,
.field select {
  width: 100%;
  font-size: 16px;    /* prevents iOS zoom */
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fdfaf3;
  min-height: 44px;
}

.field input:focus,
.field select:focus {
  outline: 3px solid var(--focus);
  outline-offset: 0;
  border-color: var(--focus);
}

.field .hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.field .error {
  font-size: 13px;
  color: var(--danger);
  margin-top: 4px;
}

/* Safety scroll box */
.safety-scroll {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  height: 320px;
  overflow-y: auto;
  background: #fdfaf3;
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 12px;
}

.safety-scroll ol { padding-inline-start: 22px; margin: 0; }
.safety-scroll li { margin-bottom: 8px; }

.scroll-hint {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 4px;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-width: 22px;
  margin-top: 3px;
}

.checkbox-row span {
  font-size: 15px;
}

.checkbox-row[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* License path selector */
.path-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.path-choice button {
  padding: 20px 12px;
  border: 2px solid var(--primary);
  background: #fdfaf3;
  color: var(--primary-strong);
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  min-height: 88px;
}

.path-choice button.active {
  background: var(--primary);
  color: #fff;
}

.capture-hint {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 10px;
}

.capture-slot {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  text-align: center;
}

.capture-slot input[type="file"] {
  display: block;
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 15px;
  min-height: 44px;
}

.capture-status {
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
}

.chip {
  display: inline-block;
  background: #ffe1c2;
  color: #7a4a10;
  border-radius: 999px;
  padding: 3px 10px;
  margin-inline-end: 6px;
  font-size: 12px;
}

.prefill-note, .self-declared-note {
  background: #fff6df;
  border-inline-start: 4px solid #d5a02c;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 12px;
  color: #5a4413;
}

.self-declared-note { background: #ecf2ea; border-color: var(--primary); color: #233d20; }

.fallback-note {
  background: #eef4fb;
  border-inline-start: 4px solid #4a7ec1;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin: 8px 0 12px;
  color: #253a5c;
}

/* Prominent nudge to also capture the back — much more visible than the small
   "back (optional)" file input above it. */
.capture-back-nudge {
  display: block;
  width: 100%;
  margin: 12px 0 4px;
  padding: 14px 16px;
  background: #fff6df;
  color: #5a4413;
  border: 1px dashed #d5a02c;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.capture-back-nudge:hover, .capture-back-nudge:focus {
  background: #fff0c8;
  outline: 2px solid #d5a02c;
}

/* Prevent the category select from truncating "רכב פרטי" / "Passenger car"
   labels on narrow screens. */
.category-row select {
  min-width: 0;
  text-overflow: ellipsis;
}

/* Categories */
.category-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}

.category-row .field { margin-bottom: 0; }
.category-row button.remove {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
}

button.add-category {
  background: transparent;
  border: 1px dashed var(--primary);
  color: var(--primary-strong);
  border-radius: 10px;
  padding: 12px;
  width: 100%;
  cursor: pointer;
  min-height: 44px;
  font-size: 15px;
}

/* Signature canvas */
.signature-box {
  border: 2px solid var(--primary);
  border-radius: 10px;
  background: #fff;
  touch-action: none;
  display: block;
  width: 100%;
  height: 200px;
  margin-bottom: 8px;
}

.signature-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}

.privacy-box {
  background: #eef4ee;
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 10px;
}

/* Navigation buttons */
.nav {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.nav button {
  flex: 1;
  padding: 14px;
  font-size: 17px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  min-height: 52px;
}

.nav .back {
  background: transparent;
  border: 1px solid var(--muted);
  color: var(--muted);
  flex: 0 0 40%;
}

.nav .next, .nav .submit {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.nav button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Success screen */
.success {
  text-align: center;
  padding: 30px 12px;
}

.success h2 { color: var(--primary-strong); }
.success .ref {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 8px 16px;
  font-family: monospace;
  font-size: 20px;
  letter-spacing: 2px;
  margin: 12px 0;
}

/* Utility */
.hidden { display: none !important; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.overlay .spinner {
  background: #fff;
  padding: 20px 26px;
  border-radius: 12px;
  font-size: 16px;
}

/* Honeypot — visually hidden but keyboard-focusable enough to be a real trap */
.honeypot {
  position: absolute !important;
  left: -9999px !important;
  height: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
}
