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

:root {
  --bg: #f5f6fa;
  --white: #fff;
  --border: #e2e5ef;
  --focus: #3b6ef8;
  --text: #0f1523;
  --muted: #6b7a99;
  --accent: #3b6ef8;
  --accent-h: #2a5de6;
  --error: #e53e3e;
}

body {
  background: var(--bg);
  font-family: 'Inter', sans-serif;
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1rem;
  color: var(--text);
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 620px;
  padding: 2.75rem 2.5rem;
  box-shadow: 0 4px 32px rgba(15,21,35,0.07);
}

.badge {
  display: inline-flex;
  align-items: center;
  background: #eff3ff;
  color: var(--accent);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: .28rem .75rem;
  border-radius: 100px;
  margin-bottom: 1rem;
}

h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: .45rem; }
.subtitle { font-size: .88rem; color: var(--muted); line-height: 1.65; margin-bottom: 2rem; }
.divider { height: 1px; background: var(--border); margin: 1.6rem 0; }

.section-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 1rem;
}

.form-grid { display: flex; flex-direction: column; gap: 1.1rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .38rem; }

label.lbl { font-size: .8rem; font-weight: 600; }
label.lbl .req { color: var(--accent); }

input[type=text],
input[type=tel],
input[type=email],
select,
textarea {
  width: 100%;
  padding: .68rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: .88rem;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

input[type=date] { cursor: pointer; }
input::placeholder, textarea::placeholder { color: #b8bfd4; }

input:focus, select:focus, textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(59,110,248,0.11);
}

.ei { border-color: var(--error) !important; box-shadow: 0 0 0 3px rgba(229,62,62,0.09) !important; }
.em { font-size: .73rem; color: var(--error); display: none; }
.em.show { display: block; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7a99' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  padding-right: 2.2rem;
  cursor: pointer;
}

textarea { resize: vertical; min-height: 72px; line-height: 1.6; }

.upload-zone {
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  padding: 1.4rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
}

.upload-zone:hover, .upload-zone.drag { border-color: var(--accent); background: #f5f7ff; }

.upload-zone input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.up-icon svg { width: 32px; height: 32px; stroke: var(--muted); fill: none; stroke-width: 1.6; }
.up-text { font-size: .84rem; color: var(--muted); margin-top: .45rem; }
.up-text strong { color: var(--accent); }
.up-hint { font-size: .71rem; color: #b8bfd4; margin-top: .22rem; }

.preview-grid { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .85rem; }

.pi {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--border);
}

.pi img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pi .del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  font-weight: 700;
}

.file-count { font-size: .72rem; color: var(--muted); margin-top: .4rem; }

.cb-field {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.6;
  cursor: pointer;
}

.cb-field input {
  width: 16px;
  height: 16px;
  min-width: 16px;
  accent-color: var(--accent);
  margin-top: .15rem;
  cursor: pointer;
}

.submit-btn {
  width: 100%;
  padding: .88rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: .98rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: .4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  transition: background .18s, transform .12s;
}

.submit-btn svg { width: 17px; height: 17px; fill: currentColor; flex-shrink: 0; }
.submit-btn:hover { background: var(--accent-h); }
.submit-btn:active { transform: scale(0.985); }
.submit-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.progress-wrap { display: none; margin-top: .75rem; }
.progress-wrap.show { display: block; }
.progress-bar-bg { background: #e8ecf7; border-radius: 100px; height: 6px; overflow: hidden; }
.progress-bar { height: 6px; background: var(--accent); border-radius: 100px; width: 0; transition: width .3s; }
.progress-label { font-size: .73rem; color: var(--muted); margin-top: .35rem; text-align: center; }

.success-box { display: none; text-align: center; padding: 1.5rem 0; }
.success-box.show { display: block; }
.s-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #48bb78;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}
.s-icon svg { width: 26px; height: 26px; stroke: #fff; fill: none; stroke-width: 2.5; }
.success-box h3 { font-size: 1.15rem; font-weight: 700; color: #1a6636; margin-bottom: .45rem; }
.success-box p { font-size: .88rem; color: #2d6a4a; line-height: 1.65; }

#toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a2035;
  color: #fff;
  padding: .7rem 1.4rem;
  border-radius: 10px;
  font-size: .84rem;
  font-weight: 500;
  transition: transform .3s, opacity .3s;
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
}

#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
#toast.terror { background: #c0392b; }

.hint { font-size: .73rem; color: var(--muted); }

@media (max-width: 500px) {
  .card { padding: 1.75rem 1.1rem; }
  .row { grid-template-columns: 1fr; }
}
