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

:root {
  --yellow: #FFD100;
  --yellow-soft: #FFF8D6;
  --yellow-hover: #FFE55C;
  --bg: #F8F8F6;
  --white: #ffffff;
  --border: #E2E2DE;
  --border-focus: #CCBA00;
  --text: #1C1C1C;
  --text-mid: #444444;
  --text-muted: #888888;
  --red: #C0392B;
  --green: #27734A;
  --shadow: 0 2px 12px rgba(0,0,0,0.07);
}

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

/* ── HEADER ── */
.header {
  background: var(--yellow-soft);
  min-height: 84px;
  display: flex;
  align-items: stretch;
}
.header-inner {
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.header-logo {
  height: 52px;
  width: auto;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}
.header-text h1 { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.2; }
.header-text p  { font-size: 12px; font-weight: 400; color: rgba(0,0,0,0.5); margin-top: 3px; }

/* ── CONTAINER ── */
.container { max-width: 700px; margin: 0 auto; padding: 28px 20px 64px; }

/* ── CARD ── */
.card {
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}
.card-header {
  padding: 15px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.card-header .icon { font-size: 17px; line-height: 1; flex-shrink: 0; }
.card-header h2 { font-size: 14px; font-weight: 700; color: var(--text); flex: 1; }
.card-body { padding: 22px 24px; }

/* ── FIELDS ── */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
  align-items: start;
}
@media(max-width:520px) { .field-row { grid-template-columns: 1fr; } }

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}
.field label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-mid);
}
.field label .req { color: var(--red); margin-left: 1px; }

.field input[type="text"],
.field input[type="email"] {
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0 13px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px; font-weight: 400;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.18s, background 0.18s;
  width: 100%;
}
.field input[type="text"]:focus,
.field input[type="email"]:focus {
  border-color: var(--border-focus);
  background: var(--white);
}
.field input.error { border-color: var(--red) !important; }

.field-error { font-size: 11px; font-weight: 500; color: var(--red); display: none; }
.field-error.visible { display: block; }

/* ── PHONE ── */
.phone-field-outer {
  position: relative;
  width: 100%;
}
.phone-wrap {
  display: flex;
  width: 100%;
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  overflow: hidden;
  transition: border-color 0.18s, background 0.18s;
}
.phone-wrap:focus-within { border-color: var(--border-focus); background: var(--white); }
.phone-wrap.error { border-color: var(--red); }

.country-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 0 10px 0 12px;
  border: none; background: none;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--text);
  border-right: 1.5px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
  outline: none;
  height: 100%;
  line-height: 1;
}
.country-flag {
  font-size: 16px;
  line-height: 1;
  display: block;
  width: 22px;
  overflow: hidden;
  height: 20px;
}
.country-code { font-size: 13px; font-weight: 600; }
.country-arrow { font-size: 9px; color: var(--text-muted); margin-left: 1px; }

.phone-number-input {
  flex: 1;
  min-width: 0;
  border: none !important;
  background: transparent !important;
  padding: 0 12px !important;
  height: 100% !important;
  outline: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  color: var(--text);
}

.country-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px); left: 0;
  width: 280px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 999;
  overflow: hidden;
}
.country-dropdown.open { display: block; }
.country-search {
  width: 100%; padding: 10px 14px;
  border: none; border-bottom: 1px solid var(--border);
  font-family: 'Montserrat', sans-serif;
  font-size: 13px; outline: none; background: var(--bg);
}
.country-list { max-height: 220px; overflow-y: auto; }
.country-option {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; cursor: pointer;
  font-size: 13px; font-weight: 500;
  transition: background 0.12s;
}
.country-option:hover { background: var(--yellow-soft); }
.country-option.selected { background: var(--yellow-soft); font-weight: 700; }
.co-flag { font-size: 18px; width: 26px; text-align: center; }
.co-name { flex: 1; color: var(--text); }
.co-code { color: var(--text-muted); font-size: 12px; }

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ── FILES GRID ── */
.files-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media(max-width:480px) { .files-grid { grid-template-columns: 1fr; } }

@media(max-width:480px) {
  #slot-foreign { order: 3 !important; }
  #slot-inn     { order: 4 !important; }
}

/* ── DROP ZONE ── */
.dz-wrap { display: flex; flex-direction: column; gap: 4px; }

.drop-zone {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px; height: 126px;
  border: 1.5px dashed var(--border);
  border-radius: 10px; background: var(--bg);
  cursor: pointer; text-align: center; padding: 12px;
  transition: border-color 0.18s, background 0.18s;
  user-select: none; overflow: hidden;
}
.drop-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.drop-zone:hover         { border-color: #BBAA00; background: var(--yellow-soft); border-style: solid; }
.drop-zone.drag-over     { border-color: #BBAA00; border-style: solid; background: #FFF4B2; transform: scale(1.015); }
.drop-zone.has-file      { border-color: var(--green); border-style: solid; background: #F1F8F4; }
.drop-zone.has-error     { border-color: var(--red); border-style: solid; background: #FFF5F5; }
.drop-zone.disabled-dz  { opacity: 0.4; pointer-events: none; }

.dz-icon     { font-size: 22px; pointer-events: none; flex-shrink: 0; }
.dz-title    { font-size: 11px; font-weight: 700; color: var(--text); pointer-events: none; line-height: 1.3; }
.dz-cta      { font-size: 10px; font-weight: 500; color: #AAA; pointer-events: none; }
.dz-hint     { font-size: 10px; color: var(--text-muted); pointer-events: none; }
.dz-req      { font-size: 9px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; background: var(--yellow); color: var(--text); border-radius: 4px; padding: 2px 8px; pointer-events: none; }
.dz-filename { font-size: 11px; font-weight: 600; color: var(--green); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.dz-size     { font-size: 10px; color: var(--green); opacity: 0.75; pointer-events: none; }

.file-warn { font-size: 10px; font-weight: 600; color: var(--red); display: none; padding-left: 2px; }
.file-warn.visible { display: block; }

/* ── INN ── */
.inn-wrap { grid-column: span 1; }
.inn-or {
  display: flex; align-items: center; gap: 10px;
  margin: 8px 0; color: var(--text-muted); font-size: 11px; font-weight: 600;
}
.inn-or::before, .inn-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.inn-number-input {
  width: 100%; height: 44px;
  border: 1.5px solid var(--border); border-radius: 8px;
  padding: 0 13px;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px; font-weight: 500; letter-spacing: 2px;
  color: var(--text); background: var(--bg);
  outline: none; transition: border-color 0.18s, background 0.18s;
}
.inn-number-input:focus    { border-color: var(--border-focus); background: var(--white); }
.inn-number-input:disabled { opacity: 0.4; cursor: not-allowed; }
.inn-number-input.error    { border-color: var(--red); }

/* ── LATIN NOTE ── */
.latin-note {
  font-size: 11px; font-weight: 500; color: var(--text-muted);
  background: var(--yellow-soft); border-radius: 6px;
  padding: 7px 12px; margin-bottom: 14px;
  transition: background 0.2s, color 0.2s;
}
.latin-note.latin-note-error { background: #FDECEA; color: var(--red); }

/* ── DOC TYPE TOGGLE ── */
.doc-type-toggle { display: flex; gap: 8px; margin-bottom: 16px; }
.doc-type-btn {
  flex: 1; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--bg);
  font-family: 'Montserrat', sans-serif;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.doc-type-btn.active { background: var(--yellow); border-color: #D4B000; color: var(--text); }

/* ── COMPANION ── */
.companion {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px 20px; margin-bottom: 12px;
}
.companion-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.companion-num { font-size: 13px; font-weight: 700; color: var(--text); }
.companion-remove {
  background: none; border: 1px solid var(--border);
  color: var(--text-muted); border-radius: 6px;
  padding: 4px 11px; font-size: 12px; font-weight: 500;
  cursor: pointer; font-family: 'Montserrat', sans-serif;
  transition: all 0.15s;
}
.companion-remove:hover { border-color: var(--red); color: var(--red); }

.type-toggle { display: flex; gap: 8px; margin-bottom: 14px; }
.type-btn {
  flex: 1; padding: 9px;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--white);
  font-family: 'Montserrat', sans-serif;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.type-btn.active-adult { background: var(--yellow); border-color: #D4B000; color: var(--text); }
.type-btn.active-child { background: #EDE7F6; border-color: #9E80C0; color: #5E35B1; }

/* ── SOLO CHECKBOX ── */
.solo-check { display: flex; align-items: center; gap: 7px; cursor: pointer; margin-left: auto; }
.solo-check input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--yellow); cursor: pointer; flex-shrink: 0; }
.solo-label { font-size: 12px; font-weight: 600; color: var(--text-mid); white-space: nowrap; }
.companions-error { display: none; font-size: 12px; font-weight: 500; color: var(--red); margin-bottom: 12px; }
.companions-error.visible { display: block; }

@media(max-width:520px) {
  .companions-header { flex-wrap: wrap; }
  .companions-header .solo-check {
    width: 100%;
    margin-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-top: 4px;
    justify-content: flex-start;
  }
}

/* ── ADD BUTTON ── */
.add-companion-btn {
  width: 100%; padding: 13px;
  border: 1.5px dashed var(--border); border-radius: 10px;
  background: none; font-family: 'Montserrat', sans-serif;
  font-size: 13px; font-weight: 600; color: var(--text-mid);
  cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.add-companion-btn:hover { background: var(--yellow-soft); border-color: #BBAA00; border-style: solid; color: var(--text); }

/* ── CONSENT ── */
.consent-wrap {
  display: flex; align-items: flex-start; gap: 10px;
  cursor: pointer; margin-bottom: 8px; text-align: left;
  max-width: 480px; margin-left: auto; margin-right: auto;
}
.consent-wrap input[type="checkbox"] { display: none; }
.consent-check-box {
  width: 20px; height: 20px; flex-shrink: 0;
  border: 2px solid var(--border); border-radius: 5px;
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; margin-top: 1px;
}
.consent-wrap input:checked ~ .consent-check-box { background: var(--yellow); border-color: #D4B000; }
.consent-wrap input:checked ~ .consent-check-box::after { content: '\2713'; font-size: 13px; font-weight: 700; color: var(--text); }
.consent-wrap.error-state .consent-check-box { border-color: var(--red); }
.consent-text { font-size: 13px; font-weight: 500; color: var(--text-mid); line-height: 1.5; }
.consent-nowrap { white-space: nowrap; }
.consent-link {
  background: none; border: none; padding: 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px; font-weight: 600; color: var(--text);
  text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer; transition: color 0.15s;
  white-space: nowrap;
}
.consent-link:hover { color: #888; }
.consent-error { text-align: center; margin-bottom: 12px; max-width: 480px; margin-left: auto; margin-right: auto; }

/* ── PRIVACY MODAL ── */
.privacy-box {
  background: var(--white); border-radius: 16px;
  max-width: 640px; width: 94%; max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.22);
  animation: popIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.privacy-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 28px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.privacy-header h3 { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.3; padding-right: 16px; }
.privacy-close {
  background: none; border: 1px solid var(--border);
  width: 32px; height: 32px; border-radius: 8px;
  font-size: 14px; color: var(--text-muted); cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.privacy-close:hover { border-color: var(--red); color: var(--red); }
.privacy-body { overflow-y: auto; padding: 24px 28px; flex: 1; font-size: 13px; line-height: 1.75; color: var(--text-mid); }
.privacy-body h4 { font-size: 13px; font-weight: 700; color: var(--text); margin: 20px 0 6px; }
.privacy-body h4:first-child { margin-top: 0; }
.privacy-body p { margin-bottom: 10px; }
.privacy-body ul { padding-left: 18px; margin-bottom: 10px; }
.privacy-body ul li { margin-bottom: 4px; }
.privacy-entity { background: var(--yellow-soft); border-radius: 8px; padding: 12px 16px; margin: 10px 0; font-size: 13px; line-height: 1.7; }
.privacy-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 18px !important; }
.privacy-footer { padding: 16px 28px; border-top: 1px solid var(--border); text-align: center; flex-shrink: 0; }

/* ── SUBMIT ── */
.submit-wrap { text-align: center; margin-top: 24px; }
.submit-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--yellow); color: var(--text);
  border: none; padding: 14px 48px; border-radius: 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px; font-weight: 700;
  cursor: pointer; transition: background 0.15s, transform 0.12s;
  box-shadow: 0 2px 8px rgba(200,170,0,0.25);
  margin-top: 15px;
}
.submit-btn:hover    { background: var(--yellow-hover); transform: translateY(-1px); }
.submit-btn:active   { transform: translateY(0); }
.submit-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.spinner {
  width: 17px; height: 17px;
  border: 2px solid rgba(0,0,0,0.18); border-top-color: var(--text);
  border-radius: 50%; animation: spin 0.7s linear infinite; display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.global-error {
  display: none; background: #FFF5F4;
  border: 1px solid #EBCFCC; border-radius: 8px;
  padding: 12px 16px; font-size: 13px; font-weight: 500;
  color: var(--red); margin-top: 14px; text-align: center;
}
.global-error.visible { display: block; }

.progress-wrap { display: none; margin-top: 14px; }
.progress-wrap.visible { display: block; }
.progress-track { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.progress-fill  { height: 100%; background: var(--yellow); width: 0%; transition: width 0.4s ease; }
.progress-label { font-size: 11px; font-weight: 500; color: var(--text-muted); text-align: center; margin-top: 6px; }

/* ── OVERLAYS ── */
.result-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.55); z-index: 1000;
  align-items: center; justify-content: center;
}
.result-overlay.visible { display: flex; }
.result-box {
  background: var(--white); border-radius: 16px;
  padding: 44px 36px; text-align: center;
  max-width: 360px; width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: popIn 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes popIn { from { transform: scale(0.88); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.result-icon { font-size: 52px; margin-bottom: 14px; }
.result-box h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.result-box p  { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.result-btn {
  display: inline-block; margin-top: 22px; padding: 12px 28px;
  background: var(--yellow); color: var(--text); border: none;
  border-radius: 8px; font-family: 'Montserrat', sans-serif;
  font-size: 13px; font-weight: 700; cursor: pointer; transition: background 0.15s;
}
.result-btn:hover { background: var(--yellow-hover); }
