﻿:root {
  --ink: #0c2340;
  --accent: #0077c8;
  --bg0: #d7e6f4;
  --bg1: #eef3f8;
  --card: #ffffff;
  --muted: #64748b;
  --line: #d5dee8;
  --ok: #0f766e;
  --danger: #b42318;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  background: var(--bg1);
  font-family: var(--font);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
body {
  background:
    radial-gradient(120% 70% at 0% 0%, rgba(0,163,224,.22), transparent 55%),
    radial-gradient(90% 50% at 100% 0%, rgba(240,106,0,.12), transparent 45%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 55%);
  background-attachment: fixed;
}
body.is-modal-open { overflow: hidden; }

.screen {
  min-height: 100dvh;
  min-height: 100svh;
  max-width: 480px;
  margin: 0 auto;
  padding: calc(10px + var(--safe-t)) 14px calc(12px + var(--safe-b));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 48px;
}
.logo { width: 40px; height: 40px; object-fit: contain; flex: 0 0 auto; }
.top__text strong { display: block; font-size: 1rem; font-weight: 800; line-height: 1.1; }
.top__text span { display: block; font-size: .75rem; color: var(--muted); font-weight: 600; }

.form {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 18px;
  padding: 12px 12px 10px;
  box-shadow: 0 12px 36px rgba(12,35,64,.08);
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-content: start;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .7rem;
  font-weight: 700;
  color: #334155;
  min-width: 0;
}
.field--full { grid-column: 1 / -1; }
.field .req { color: #ea580c; }
.field input,
.field select,
.field textarea {
  width: 100%;
  margin: 0;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  font-size: .86rem;
  font-weight: 500;
  color: var(--ink);
  background: #f7fafc;
  min-height: 40px;
}
.field textarea { min-height: 52px; resize: none; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,119,200,.14);
}
.field input[type=file] {
  padding: 7px 8px;
  font-size: .78rem;
  background: #fff;
  border-style: dashed;
}
.captcha-q {
  font-size: .82rem;
  font-weight: 700;
  color: var(--ink);
}
.check {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.35;
  color: #334155;
}
.check input {
  width: 18px; height: 18px; margin-top: 1px; flex: 0 0 auto;
  accent-color: var(--accent);
}
.check button.linkish {
  border: 0; background: none; padding: 0;
  color: var(--accent); font: inherit; font-weight: 800;
  text-decoration: underline; cursor: pointer;
}

.btn {
  flex: 0 0 auto;
  margin-top: 8px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 13px 14px;
  font: inherit;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #0c2340 0%, #0077c8 75%, #00a3e0 100%);
  box-shadow: 0 10px 22px rgba(0,119,200,.25);
}
.btn:disabled { opacity: .55; cursor: wait; }
.btn--soft {
  background: #e8eef5;
  color: var(--ink);
  box-shadow: none;
  margin-top: 10px;
}
.msg {
  flex: 0 0 auto;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: .84rem;
  font-weight: 700;
  line-height: 1.35;
}
.msg.is-ok { background: #d1fae5; color: var(--ok); border: 1px solid #a7f3d0; }
.msg.is-err { background: #fee4e2; color: var(--danger); border: 1px solid #fecaca; }

.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea {
  border-color: #f97066 !important;
  background: #fff8f7 !important;
}
.field__err {
  display: block;
  margin-top: 4px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--danger);
}
.check.is-invalid { outline: 1px solid #fecaca; border-radius: 10px; padding: 6px; background: #fff8f7; }

.addr-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.btn-loc {
  border: 1.5px solid var(--accent);
  background: #eef7fc;
  color: var(--accent);
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
}
.btn-loc:disabled { opacity: .55; cursor: wait; }
.addr-hint {
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.3;
}

.success-card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 18px;
  padding: 28px 18px 20px;
  text-align: center;
  box-shadow: 0 12px 36px rgba(12,35,64,.08);
}
.success-card__ico {
  width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: 999px; background: #d1fae5; color: var(--ok);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 800;
}
.success-card h2 { margin: 0 0 8px; font-size: 1.2rem; }
.success-card p { margin: 0 0 18px; color: var(--muted); font-size: .9rem; line-height: 1.45; }

.modal[hidden] { display: none !important; }
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(12,35,64,.48);
  backdrop-filter: blur(2px);
}
.modal__sheet {
  position: relative;
  width: min(480px, 100%);
  max-height: min(78dvh, 560px);
  margin: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(14px + var(--safe-b));
  display: flex;
  flex-direction: column;
  box-shadow: 0 -12px 40px rgba(0,0,0,.18);
  animation: up .28s ease;
}
@keyframes up {
  from { transform: translateY(24px); opacity: .6; }
  to { transform: none; opacity: 1; }
}
.modal__head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex: 0 0 auto;
}
.modal__head h2 { margin: 0; font-size: 1.05rem; }
.modal__x {
  border: 0; background: #eef2f7; width: 36px; height: 36px;
  border-radius: 999px; font-size: 1.3rem; cursor: pointer; color: var(--ink);
}
.modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  margin: 12px 0 0;
  font-size: .86rem;
  line-height: 1.45;
  color: #334155;
  -webkit-overflow-scrolling: touch;
}
.modal__body h3 { margin: 14px 0 4px; font-size: .9rem; color: var(--ink); }
.modal__body p { margin: 0 0 8px; }

@media (min-height: 780px) {
  .field input, .field select { min-height: 44px; padding: 11px 12px; }
  .fields { gap: 10px; }
}
@media (max-height: 700px) {
  .top { min-height: 40px; }
  .logo { width: 34px; height: 34px; }
  .field input, .field select, .field textarea { min-height: 36px; padding: 7px 9px; font-size: .82rem; }
  .field textarea { min-height: 44px; }
  .btn { padding: 11px 12px; }
  .form { padding: 10px; }
}
@media (min-width: 720px) {
  .modal { align-items: center; }
  .modal__sheet {
    border-radius: 18px;
    margin: 16px;
    max-height: 70vh;
  }
}
