/* ==================================================================
   Чёрно-белый минимализм. Белый фон, чёрный текст.
   Совместимо со старыми Android WebView, iOS Safari 6+.
   ================================================================== */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }

:root {
  --bg: #ffffff;
  --bg-2: #fafafa;
  --surface: #f7f7f7;
  --surface-2: #f0f0f0;
  --surface-3: #e6e6e6;

  --border: rgba(0, 0, 0, 0.08);
  --border-2: rgba(0, 0, 0, 0.14);
  --border-3: rgba(0, 0, 0, 0.32);

  --text: #0a0a0a;
  --text-2: #545454;
  --text-3: #8a8a8a;

  --danger: #c0392b;
  --success: #2d6a4f;
  --warn: #b7791f;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 0 4px rgba(0, 0, 0, 0.08);
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  margin: 0 0 12px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
p { margin: 0 0 12px; color: var(--text-2); }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-3); text-underline-offset: 3px; transition: text-decoration-color 0.15s ease; }
a:hover { text-decoration-color: var(--text); }
small { color: var(--text-3); }
img, svg { max-width: 100%; height: auto; display: block; }

.container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 18px;
}

/* ============== HERO ============== */
.hero {
  position: relative;
  background: var(--bg);
  padding: 80px 0 96px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero:before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  width: 1200px;
  height: 600px;
  margin-left: -600px;
  background-image: -webkit-radial-gradient(50% 0%, ellipse 50% 50%, rgba(0,0,0,0.04) 0%, rgba(0,0,0,0) 60%);
  background-image: radial-gradient(ellipse 50% 50% at 50% 0%, rgba(0,0,0,0.04) 0%, rgba(0,0,0,0) 60%);
  pointer-events: none;
}
.hero .container { position: relative; }

.hero h1 {
  color: var(--text);
  font-size: 32px;
  margin: 18px 0 18px;
  letter-spacing: -0.025em;
  font-weight: 700;
}
.hero .lead {
  color: var(--text-2);
  font-size: 16px;
  max-width: 540px;
  margin: 0 auto 32px;
  line-height: 1.6;
}
.badge {
  display: inline-block;
  background: transparent;
  color: var(--text-2);
  padding: 7px 16px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--border-2);
}

/* ============== Hero contacts ============== */
.hero-contacts {
  margin-top: 32px;
  display: block;
  text-align: center;
}
.hero-contact {
  display: inline-block;
  padding: 10px 18px;
  margin: 4px 6px;
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 100px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
  vertical-align: middle;
}
.hero-contact:hover {
  border-color: var(--text);
  background: var(--surface);
  text-decoration: none;
}
.hero-contact:active { -webkit-transform: translateY(1px); transform: translateY(1px); }
.hero-contact-label {
  display: inline-block;
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 8px;
  font-weight: 500;
}
.hero-contact-value {
  display: inline-block;
  color: var(--text);
  font-weight: 600;
  font-size: 14.5px;
}

/* ============== Buttons ============== */
.btn {
  display: inline-block;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 100px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
  min-height: 50px;
  letter-spacing: 0.01em;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.1s ease;
}
.btn-primary {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.btn-primary:hover {
  background: #2a2a2a;
  border-color: #2a2a2a;
  text-decoration: none;
}
.btn-primary:active {
  transform: translateY(1px);
}
.btn-primary:disabled {
  background: var(--surface-3);
  color: var(--text-3);
  border-color: var(--surface-3);
  cursor: not-allowed;
  transform: none;
}
.btn-lg { padding: 16px 36px; font-size: 16px; min-height: 54px; }
.btn-block { display: block; width: 100%; }

/* ============== Features ============== */
.features {
  padding: 56px 0 24px;
  background: var(--bg);
}
.feature {
  background: var(--surface);
  padding: 24px 22px;
  border-radius: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}
.feature:hover {
  border-color: var(--border-2);
  background: var(--surface-2);
  -webkit-transform: translateY(-2px);
  transform: translateY(-2px);
}
.feature h3 {
  font-size: 17px;
  margin: 14px 0 8px;
  color: var(--text);
  font-weight: 600;
}
.feature p {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.55;
}
.feature-icon {
  font-size: 22px;
  line-height: 44px;
  display: inline-block;
  width: 44px;
  height: 44px;
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 50%;
  text-align: center;
  -webkit-filter: grayscale(100%);
  filter: grayscale(100%);
}

/* ============== Form ============== */
.form-section {
  padding: 64px 0 88px;
  background: var(--bg);
}
.form-section h2 {
  font-size: 28px;
  margin-bottom: 10px;
  font-weight: 700;
}
.form-intro {
  color: var(--text-2);
  margin-bottom: 32px;
  font-size: 15px;
}

fieldset {
  margin: 0 0 16px;
  padding: 24px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 0.2s ease;
}
fieldset:hover { border-color: var(--border-2); }
legend {
  padding: 4px 14px;
  font-weight: 600;
  color: var(--text-2);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  margin-left: -4px;
}

.field { display: block; margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }

.field-label {
  display: block;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}
.req {
  color: var(--text-3);
  margin-left: 2px;
}

.hint {
  display: block;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 10px;
  line-height: 1.5;
}

/* ============== Inputs ============== */
input[type="text"],
input[type="date"],
input[type="email"],
input[type="tel"],
textarea {
  display: block;
  width: 100%;
  padding: 13px 16px;
  font-size: 16px;
  font-family: inherit;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  min-height: 50px;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { color: var(--text-3); }
input::-moz-placeholder, textarea::-moz-placeholder { color: var(--text-3); opacity: 1; }
input:-ms-input-placeholder, textarea:-ms-input-placeholder { color: var(--text-3); }
input::placeholder, textarea::placeholder { color: var(--text-3); }

input[type="date"] {
  -webkit-appearance: none;
  color-scheme: light;
}
::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.55; }
::-webkit-calendar-picker-indicator:hover { opacity: 1; }

textarea { resize: vertical; min-height: 140px; }

input:focus, textarea:focus {
  border-color: var(--text);
  background: var(--bg);
  box-shadow: var(--shadow-glow);
}

/* ============== Radio / Checkbox ============== */
.radio-group { display: block; margin-top: 4px; }
.radio-group .radio { display: inline-block; margin-right: 8px; margin-bottom: 8px; }
.radio-group-vert .radio { display: block; margin-right: 0; }
.radio, .checkbox {
  position: relative;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.4;
}
.radio input, .checkbox input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}
.radio > span, .checkbox > span {
  display: inline-block;
  padding: 13px 18px 13px 46px;
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  color: var(--text-2);
  position: relative;
  min-height: 50px;
  vertical-align: middle;
  -webkit-user-select: none;
  user-select: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.radio:hover > span, .checkbox:hover > span {
  border-color: var(--border-3);
  color: var(--text);
}
.radio > span:before {
  content: "";
  position: absolute;
  top: 50%;
  left: 16px;
  margin-top: -10px;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-3);
  border-radius: 50%;
  background: var(--bg);
  box-sizing: border-box;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.checkbox > span:before {
  content: "";
  position: absolute;
  top: 50%;
  left: 16px;
  margin-top: -10px;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-3);
  border-radius: 5px;
  background: var(--bg);
  box-sizing: border-box;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.radio input:checked + span,
.checkbox input:checked + span {
  background: var(--surface-2);
  border-color: var(--text);
  color: var(--text);
  font-weight: 600;
}
.radio input:checked + span:before {
  border-color: var(--text);
  background: var(--text);
  box-shadow: inset 0 0 0 4px var(--bg);
}
.checkbox input:checked + span:before {
  background: var(--text);
  border-color: var(--text);
}
/* .req — звёздочка обязательного поля внутри label, не должна выглядеть как ещё один чекбокс */
.checkbox .req, .radio .req {
  display: inline;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  min-height: 0;
  vertical-align: baseline;
  color: var(--text-3);
  font-weight: inherit;
}
.checkbox .req:before, .radio .req:before { content: none; }
.checkbox input:checked + span:after {
  content: "";
  position: absolute;
  top: 50%;
  left: 21px;
  margin-top: -7px;
  width: 6px;
  height: 11px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  -webkit-transform: rotate(45deg);
  transform: rotate(45deg);
}
.radio input:focus + span,
.checkbox input:focus + span { box-shadow: var(--shadow-glow); }

.checkbox { display: block; padding-left: 0; }

/* ============== Voice recording ============== */
.voice-controls {
  display: block;
  margin-top: 12px;
}
.voice-btn {
  display: inline-block;
  padding: 12px 18px 12px 16px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 100px;
  cursor: pointer;
  font-family: inherit;
  vertical-align: middle;
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.voice-btn:hover { border-color: var(--text); }
.voice-btn:disabled { cursor: wait; opacity: 0.6; }

.voice-dot {
  display: inline-block;
  width: 9px; height: 9px;
  background: var(--text-3);
  border-radius: 50%;
  margin-right: 9px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.voice-btn.recording {
  background: rgba(239, 68, 68, 0.06);
  border-color: var(--danger);
  color: var(--danger);
}
.voice-btn.recording .voice-dot {
  background: var(--danger);
  -webkit-animation: voicePulse 1.1s ease-in-out infinite;
  animation: voicePulse 1.1s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
}
@-webkit-keyframes voicePulse {
  0%   { -webkit-transform: scale(1);   box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  70%  { -webkit-transform: scale(1.4); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { -webkit-transform: scale(1);   box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
@keyframes voicePulse {
  0%   { transform: scale(1);   box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  70%  { transform: scale(1.4); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { transform: scale(1);   box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.voice-btn.processing {
  background: var(--surface);
  color: var(--text-2);
  border-color: var(--border-2);
  cursor: wait;
}
.voice-btn.processing .voice-dot {
  background: var(--text-2);
  -webkit-animation: voiceSpin 0.9s linear infinite;
  animation: voiceSpin 0.9s linear infinite;
  border-radius: 50%;
  box-shadow: inset 2px 0 0 0 transparent;
}
@-webkit-keyframes voiceSpin { to { -webkit-transform: rotate(360deg); } }
@keyframes voiceSpin { to { transform: rotate(360deg); } }

.voice-hint {
  display: block;
  font-size: 13px;
  color: var(--text-3);
  margin-top: 10px;
  line-height: 1.5;
}
.voice-hint.error { color: var(--danger); }

/* ============== File upload ============== */
.file-upload { display: block; position: relative; cursor: pointer; }
.file-upload input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  overflow: hidden;
}
.file-upload-btn {
  display: inline-block;
  padding: 13px 22px;
  background: var(--bg);
  color: var(--text);
  border-radius: 10px;
  border: 1px dashed var(--border-3);
  font-weight: 500;
  font-size: 15px;
  min-height: 50px;
  line-height: 22px;
  vertical-align: middle;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.file-upload:hover .file-upload-btn {
  background: var(--surface-2);
  border-color: var(--text);
}
.file-list {
  display: block;
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-2);
  word-break: break-word;
}
.file-list .file-item {
  display: block;
  padding: 8px 12px;
  margin-bottom: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text);
}
.file-list .file-item small {
  color: var(--text-3);
  font-size: 12px;
  margin-left: 6px;
}

/* ============== Errors ============== */
.form-error {
  background: rgba(192, 57, 43, 0.05);
  color: var(--danger);
  border: 1px solid rgba(192, 57, 43, 0.25);
  padding: 14px 18px;
  border-radius: 10px;
  margin: 18px 0;
  font-size: 14px;
  line-height: 1.5;
}

/* ============== Loading ============== */
.loading {
  text-align: center;
  padding: 64px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-top: 24px;
}
.loading p { color: var(--text); font-weight: 500; }
.loading small { color: var(--text-3); }
.spinner {
  width: 56px;
  height: 56px;
  border: 2px solid var(--border-2);
  border-top-color: var(--text);
  border-radius: 50%;
  margin: 0 auto 20px;
  -webkit-animation: spin 0.9s linear infinite;
  animation: spin 0.9s linear infinite;
}
@-webkit-keyframes spin { to { -webkit-transform: rotate(360deg); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============== Result ============== */
.result { margin-top: 28px; }
.result-card {
  background: var(--bg);
  border-radius: 16px;
  padding: 32px 24px;
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow-md);
  -webkit-animation: fadeUp 0.4s ease;
  animation: fadeUp 0.4s ease;
}
@-webkit-keyframes fadeUp { from { opacity: 0; -webkit-transform: translateY(12px); } to { opacity: 1; -webkit-transform: translateY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.result-header { text-align: center; margin-bottom: 32px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.result-header h3 {
  color: var(--text);
  font-size: 22px;
  margin-bottom: 8px;
  font-weight: 700;
}
.result-header p { color: var(--text-2); }

.score-block {
  background: var(--surface);
  border-radius: 14px;
  padding: 28px 22px;
  text-align: center;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}
.score-label {
  font-size: 11.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 18px;
  font-weight: 600;
}
.score-bar {
  width: 100%;
  height: 8px;
  background: var(--surface-3);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 20px;
}
.score-fill {
  height: 100%;
  width: 0;
  background: var(--text);
  transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease;
  border-radius: 100px;
}
.score-fill.low { background: var(--danger); }
.score-fill.mid { background: var(--text-2); }
.score-fill.high { background: var(--text); }
.score-value {
  font-size: 44px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1;
}
.score-suffix {
  font-size: 18px;
  color: var(--text-3);
  font-weight: 400;
  margin-left: 2px;
  letter-spacing: 0;
}

.result-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.result-section:last-of-type { border-bottom: 0; padding-bottom: 0; }
.result-section h4 {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  margin-bottom: 12px;
  font-weight: 600;
}
.result-section p {
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
}
.result-section ul {
  padding-left: 0;
  margin: 0;
  list-style: none;
}
.result-section li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  line-height: 1.6;
  color: var(--text);
}
.result-section li:before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 8px;
  height: 1px;
  background: var(--text-3);
}

.result-disclaimer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.55;
}

/* ============== Footer ============== */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  color: var(--text-3);
  text-align: center;
  padding: 36px 0;
  font-size: 13px;
}
.footer p { margin: 0 0 6px; color: var(--text-2); }
.footer .muted { color: var(--text-3); font-size: 12px; }

.footer-contacts {
  display: block;
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.footer-contact {
  display: inline-block;
  padding: 12px 22px;
  margin: 4px 6px;
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  text-align: left;
  vertical-align: middle;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.footer-contact:hover {
  border-color: var(--text);
  background: var(--surface);
  text-decoration: none;
}
.footer-contact-label {
  display: block;
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  margin-bottom: 2px;
}
.footer-contact-value {
  display: block;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
}

/* ============== Desktop ============== */
@media (min-width: 720px) {
  .container { padding: 0 24px; }
  .hero { padding: 112px 0 120px; }
  .hero h1 { font-size: 52px; }
  .hero .lead { font-size: 18px; }
  .features { padding: 64px 0 32px; }
  .features .container {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    margin-left: -8px;
    margin-right: -8px;
  }
  .feature {
    -ms-flex: 1 1 30%;
    flex: 1 1 30%;
    margin: 0 8px 16px;
  }
  .form-section { padding: 80px 0 96px; }
  .form-section h2 { font-size: 36px; }
  fieldset { padding: 28px; }
  .result-card { padding: 40px 36px; }
  .score-value { font-size: 56px; }
}

/* ============== Edge: small phones ============== */
@media (max-width: 359px) {
  .container { padding: 0 14px; }
  .hero { padding: 64px 0 72px; }
  .hero h1 { font-size: 26px; }
  .btn-lg { font-size: 15px; padding: 14px 22px; }
  fieldset { padding: 18px 14px; }
}

/* ============== Selection ============== */
::selection { background: var(--text); color: #fff; }
::-moz-selection { background: var(--text); color: #fff; }

/* ============== Scrollbar (WebKit) ============== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 100px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-3); }

/* ============== meta theme color override (для PWA) ============== */
