
@font-face {
  font-family: 'AvenirNextCyr-Thin';
  src: url('/static/fonts/avenir/AvenirNextCyr-Thin.woff');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'AvenirNextCyr-Regular';
  src: url('/static/fonts/avenir/AvenirNextCyr-Regular.woff');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'AvenirNextCyr-Demi';
  src: url('/static/fonts/avenir/AvenirNextCyr-Demi.woff');
  font-weight: normal;
  font-style: normal;
}

:root {
  --bg: #F1FAEE;
  --dark: #1D3557;
  --primary: #457B9D;
  --primary-dark: #35637f;
  --accent: #A8DADC;
  --danger: #E63946;
  --success: #3ab627;
  --muted: #7d93a8;
  --border: #d7e3e6;
  --white: #ffffff;
  --radius: 12px;
  --font: 'AvenirNextCyr-Regular', 'Helvetica Neue', Arial, sans-serif;
  --font-demi: 'AvenirNextCyr-Demi', 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--dark);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--primary); }

.topbar {
  background: var(--primary);
  color: var(--white);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: solid 2px var(--bg);
}
.topbar h1 {
  font-family: var(--font-demi);
  font-size: 18px;
  margin: 0;
  font-weight: normal;
}
.topbar nav { display: flex; gap: 16px; align-items: center; }
.topbar nav a {
  color: var(--white);
  text-decoration: none;
  font-size: 14px;
  opacity: .85;
}
.topbar nav a:hover { opacity: 1; text-decoration: underline; }

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}
.page--narrow { max-width: 460px; }

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 18px;
}

h2 {
  font-family: var(--font-demi);
  font-size: 20px;
  font-weight: normal;
  margin: 0 0 6px;
}
h3 {
  font-family: var(--font-demi);
  font-size: 16px;
  font-weight: normal;
  margin: 22px 0 10px;
}
.subtitle {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 20px;
}

/* --- Stepper --- */
.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}
.stepper-item {
  flex: 1 1 0;
  min-width: 26px;
  height: 5px;
  border-radius: 3px;
  background: var(--border);
}
.stepper-item.done { background: var(--accent); }
.stepper-item.current { background: var(--primary); }
.step-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}

/* --- Forms --- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--dark);
  margin-bottom: 6px;
}
.field .hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--dark);
  font-family: var(--font);
  font-size: 15px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
input.invalid, select.invalid { border-color: var(--danger); }
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--primary);
}
.field-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 5px;
  min-height: 1px;
}

.otp-input {
  letter-spacing: 8px;
  font-size: 22px;
  text-align: center;
  font-family: var(--font-demi);
}

/* --- Buttons --- */
button, .btn {
  display: inline-block;
  padding: 11px 20px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: var(--white);
  font-family: var(--font);
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
button:hover:not(:disabled), .btn:hover { background: var(--primary-dark); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.secondary, .btn.secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border);
}
button.secondary:hover:not(:disabled) { background: var(--bg); }
button.danger { background: var(--danger); }
button.link {
  background: none;
  color: var(--primary);
  padding: 4px 0;
  text-decoration: underline;
  font-size: 14px;
}
button.link:hover { background: none; color: var(--primary-dark); }
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 22px;
}
.actions .spacer { flex: 1; }

/* --- Choice tiles (employment type) --- */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.choice {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  background: var(--white);
  text-align: left;
  color: var(--dark);
}
.choice:hover { border-color: var(--primary); background: var(--white); }
.choice.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(69,123,157,.18); }
.choice .choice-title { font-family: var(--font-demi); font-size: 16px; display: block; }
.choice .choice-desc { font-size: 12px; color: var(--muted); display: block; margin-top: 4px; }

/* --- Alerts --- */
.alert {
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}
.alert.show { display: block; }
.alert.error { background: #fdecee; color: #a3242f; border: 1px solid #f5c2c7; }
.alert.success { background: #e8f6e6; color: #256c1a; border: 1px solid #bfe3b8; }
.alert.info { background: #eaf3f7; color: #2c586b; border: 1px solid #cbe0ea; }

/* --- Document list --- */
.doc-list { display: flex; flex-direction: column; gap: 12px; }
.doc-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.doc-item .doc-info { flex: 1; min-width: 180px; }
.doc-item .doc-name { font-family: var(--font-demi); font-size: 14px; }
.doc-item .doc-desc { font-size: 12px; color: var(--muted); }
.doc-status {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--bg);
  color: var(--muted);
  white-space: nowrap;
}
.doc-status.uploaded { background: #e8f6e6; color: #256c1a; }
.doc-item input[type="file"] { flex: 1 1 220px; width: auto; font-size: 13px; padding: 7px; }

.rows { display: flex; flex-direction: column; }
.row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.row:last-child { border-bottom: none; }
.row .row-key { color: var(--muted); }
.row .row-val { text-align: right; word-break: break-word; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  background: var(--accent);
  color: var(--dark);
}

.backup-codes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  background: var(--bg);
  padding: 14px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 15px;
  margin: 12px 0;
}

.pdf-frame {
  width: 100%;
  height: 460px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.muted-note { font-size: 12px; color: var(--muted); margin-top: 14px; }

.hidden { display: none !important; }

.spinner-note { font-size: 13px; color: var(--muted); }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  color: var(--muted);
  font-size: 13px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.signup-cta {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.signup-cta h3 { margin-top: 0; }
.signup-cta .subtitle { margin-bottom: 14px; }

@media (max-width: 560px) {
  .page { padding: 18px 14px 50px; }
  .card { padding: 18px; }
  .row { flex-direction: column; gap: 2px; }
  .row .row-val { text-align: left; }

  .topbar {
    height: auto;
    min-height: 60px;
    flex-wrap: wrap;
    gap: 4px 14px;
    padding: 10px 14px;
  }
  .topbar h1 { font-size: 16px; }
  .topbar nav { gap: 12px; flex-wrap: wrap; }
  .topbar nav a { font-size: 13px; }

  .actions button, .actions .btn { flex: 1 1 100%; }
  .actions .spacer { display: none; }
}

.password-wrap { position: relative; }
.password-wrap input[type="password"],
.password-wrap input[type="text"] { padding-right: 88px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: auto;
  margin: 0;
  padding: 5px 9px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
}
.password-toggle:hover { color: var(--dark); background: var(--bg); }
.password-toggle:focus-visible { outline: 2px solid var(--accent, #457B9D); outline-offset: 1px; }


/* Баннер о неушедшем письме. Показывается поверх любого экрана онбординга:
   отказ SMTP приходит ответом 200, и встроенного места под такое сообщение на шагах нет. */
.mail-failure-banner {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 9999;
  max-width: min(560px, calc(100vw - 32px));
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid #E63946;
  background: #FDECEE;
  color: #7A1B24;
  font-size: 14px;
  line-height: 20px;
  box-shadow: 0 6px 24px rgba(29, 53, 87, 0.18);
}

.mail-failure-banner-text {
  flex: 1;
}

.mail-failure-banner-close {
  flex: none;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 20px;
  line-height: 20px;
  cursor: pointer;
  padding: 0 2px;
}
