:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #6d7a86;
  --line: #dce5ea;
  --panel: #ffffff;
  --wash: #f4f7f9;
  --blue: #087ea4;
  --blue-soft: #e3f5fa;
  --green: #198754;
  --red: #a53c3c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at top, #e8f7fa, var(--wash) 43%); }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px 22px; }
.auth-card { width: min(470px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 38px; box-shadow: 0 20px 70px rgba(32, 60, 75, .12); }
.auth-card-wide { width: min(720px, 100%); }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 24px; border-radius: 15px; color: white; background: var(--blue); font-size: 16px; font-weight: 900; letter-spacing: -.08em; box-shadow: 0 8px 18px rgba(8,126,164,.25); }
.eyebrow { margin: 0 0 10px; color: var(--blue); font-weight: 850; letter-spacing: .12em; font-size: 11px; }
h1 { margin: 0 0 12px; font-size: clamp(30px, 6vw, 42px); letter-spacing: -.05em; line-height: 1; }
h2 { margin: 10px 0 14px; font-size: 20px; letter-spacing: -.02em; }
.lead { margin: 0 0 26px; color: var(--muted); line-height: 1.55; }
.auth-button { display: inline-flex; justify-content: center; align-items: center; width: 100%; min-height: 48px; border: 0; border-radius: 10px; background: var(--blue); color: white; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; transition: filter .15s, transform .15s; }
.auth-button:hover { filter: brightness(.94); transform: translateY(-1px); }
.auth-button:disabled { opacity: .5; cursor: wait; transform: none; }
.auth-button.secondary { color: var(--blue); background: white; border: 1px solid #add5e1; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 19px 0; color: #a5b2ba; font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.auth-note, .auth-footer { color: var(--muted); font-size: 12px; line-height: 1.5; }
.auth-note { margin: 20px 0 0; text-align: center; }
.auth-footer { margin: 16px 0 0; }
.back-link { display: inline-block; margin-bottom: 28px; color: var(--blue); font-size: 13px; font-weight: 750; text-decoration: none; }
.field { display: grid; gap: 7px; margin-bottom: 15px; color: var(--muted); font-size: 12px; font-weight: 750; }
.field em { font-weight: 500; font-style: normal; }
.field input { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; color: var(--ink); background: white; font: inherit; font-size: 16px; outline: none; }
.field input:focus { border-color: #72bed0; box-shadow: 0 0 0 3px rgba(8,126,164,.11); }
.field input[aria-invalid="true"] { border-color: var(--red); }
.field-error { color: var(--red); font-size: 12px; font-weight: 650; line-height: 1.4; }
.inn-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 10px; align-items: end; }
.lookup-button { min-height: 46px; margin-bottom: 15px; font-size: 12px; }
.form-error { margin: 12px 0; padding: 11px 13px; border: 1px solid #e7b6b6; border-radius: 10px; color: var(--red); background: #fff3f3; font-size: 13px; line-height: 1.4; }
.hidden { display: none !important; }
.organization-preview { margin: 18px 0; padding: 16px; border: 1px solid #b8e4ee; border-radius: 14px; background: #f6fcfd; }
.okved-selection { margin: 18px 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfe; }
.okved-selection h2 { margin: 0 0 6px; font-size: 17px; }
.okved-help, .okved-empty { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.okved-candidates { display: grid; gap: 7px; margin: 0; padding: 0; border: 0; }
.okved-manual { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.okved-manual .field { flex: 1; min-width: 160px; margin: 0; }
.okved-manual button { width: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.okved-option { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; font-size: 12px; line-height: 1.4; }
.okved-option input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--blue); }
.okved-description { flex: 1; overflow-wrap: anywhere; }
.okved-main { flex: 0 0 auto; padding: 3px 7px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 10px; font-weight: 800; }
.okved-option:focus-within { border-color: #72bed0; box-shadow: 0 0 0 3px rgba(8,126,164,.11); }
.organization-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; color: var(--green); font-size: 12px; font-weight: 800; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 99px; background: var(--green); }
.badge { display: inline-block; border-radius: 999px; padding: 4px 8px; background: #e6eff2; color: #52616c; font-size: 10px; font-weight: 850; }
.organization-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.organization-grid > div { min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.organization-grid .wide { grid-column: 1 / -1; }
.organization-grid small, .organization-facts b { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 700; }
.organization-grid strong { display: block; overflow-wrap: anywhere; word-break: normal; font-size: 12px; line-height: 1.35; }
.organization-preview h2 { overflow-wrap: anywhere; line-height: 1.25; }
.organization-details { margin-top: 13px; border-top: 1px solid var(--line); padding-top: 12px; }
.organization-details summary { color: var(--blue); cursor: pointer; font-size: 12px; font-weight: 800; }
.organization-facts { display: grid; gap: 8px; margin-top: 10px; }
.organization-facts > div { padding: 9px 10px; border-radius: 8px; background: white; font-size: 11px; line-height: 1.45; }
.organization-facts span { display: block; overflow-wrap: anywhere; }
.organization-json { max-height: 230px; overflow: auto; margin: 10px 0 0; padding: 10px; border-radius: 8px; background: #17212b; color: #e9f2f5; font-size: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .auth-shell { min-height: 100vh; min-height: 100svh; min-height: 100dvh; align-content: start; padding: max(12px, env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)); }
  .auth-card, .auth-card-wide { width: 100%; padding: 24px 18px; border-radius: 18px; }
  .brand-mark { margin-bottom: 18px; }
  .lead { margin-bottom: 20px; }
  .back-link { margin-bottom: 20px; padding: 8px 0; }
  .inn-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .lookup-button { margin-bottom: 14px; }
  .organization-grid { grid-template-columns: 1fr; }
  .organization-grid .wide { grid-column: auto; }
  .form-section { margin: 0 0 18px; }
  .form-section-heading { margin: 0 0 12px; font-size: 16px; }
  .field { gap: 8px; margin-bottom: 14px; font-size: 13px; }
  .field input { min-height: 48px; font-size: 16px; }
  .auth-button { min-height: 48px; padding: 10px 14px; }
  .okved-selection, .organization-preview { padding: 14px; }
  .okved-option { min-height: 44px; align-items: center; }
  .okved-option input { width: 20px; height: 20px; }
  .okved-manual { align-items: stretch; flex-direction: column; }
  .okved-manual .field { min-width: 0; }
  .okved-manual button { width: 100%; }
  .registration-actions { margin: 16px 0 0; padding: 0 0 calc(8px + env(safe-area-inset-bottom)); }
  .field input, .lookup-button, .registration-actions .auth-button { scroll-margin-top: 16px; scroll-margin-bottom: 120px; }
  .auth-footer { margin-bottom: 0; text-align: center; }
}
