/* =========================================================
   ООО «Нова» — заявления сотрудников
   Адаптивная тема: телефон → планшет → десктоп
   ========================================================= */

:root {
  --bg-0: #070a1c;
  --bg-1: #101635;
  --glow: #3f6ae0;

  --card: #ffffff;
  --card-soft: #f5f7fd;

  --ink: #111631;
  --ink-soft: #3a4268;
  --muted: #7982a6;

  --line: #e3e7f4;
  --line-strong: #c8d0e7;

  --accent: #3f6ae0;
  --accent-ink: #2b4fba;
  --accent-soft: #ecf1ff;
  --accent-grad: linear-gradient(135deg, #3f6ae0 0%, #6a54e8 100%);

  --ok: #0f9d6b;
  --ok-soft: #e6f7f0;
  --err: #e0435c;
  --err-soft: #fdecf0;

  --r-xl: 24px;
  --r-lg: 18px;
  --r-md: 13px;
  --r-sm: 9px;

  --shadow-card: 0 40px 80px -40px rgba(5, 9, 40, 0.7),
                 0 12px 28px -16px rgba(5, 9, 40, 0.45);
  --shadow-btn: 0 10px 24px -10px rgba(63, 106, 224, 0.7);

  --maxw: 1120px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--bg-1);
  background-image:
    radial-gradient(900px 520px at 50% -12%, rgba(96, 133, 255, 0.42), transparent 62%),
    radial-gradient(700px 420px at 92% 8%, rgba(122, 84, 240, 0.24), transparent 60%),
    linear-gradient(180deg, #161d47 0%, #0d1230 46%, #070a1c 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

/* ---------- Каркас страницы ---------- */

.page {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(16px, 3vw, 40px) clamp(14px, 3vw, 28px) 132px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: clamp(18px, 3vw, 34px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--accent-grad);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 10px 22px -12px rgba(63, 106, 224, 0.9);
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-sub {
  color: rgba(226, 232, 255, 0.62);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(232, 237, 255, 0.9);
  font-size: 12.5px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade9b;
  box-shadow: 0 0 0 3px rgba(74, 222, 155, 0.2);
}

.hero {
  max-width: 720px;
  margin-bottom: clamp(20px, 3vw, 34px);
}

.hero h1 {
  margin: 0 0 10px;
  color: #fff;
  font-size: clamp(26px, 4.4vw, 38px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0;
  color: rgba(226, 232, 255, 0.72);
  font-size: clamp(15px, 1.6vw, 17px);
}

/* ---------- Сетка ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(16px, 2.4vw, 26px);
  align-items: start;
}

@media (min-width: 1000px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 336px;
  }
}

.card {
  background: var(--card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  padding: clamp(18px, 2.6vw, 32px);
}

/* ---------- Секции ---------- */

.section + .section {
  margin-top: clamp(22px, 3vw, 34px);
  padding-top: clamp(22px, 3vw, 34px);
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.step {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 700;
}

.section-title {
  margin: 0;
  font-size: clamp(17px, 2vw, 20px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-hint {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
}

/* ---------- Поля ---------- */

.grid {
  display: grid;
  gap: 14px 16px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 560px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.field {
  min-width: 0;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.req {
  color: var(--err);
  margin-left: 2px;
}

.field-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.input,
.select {
  width: 100%;
  min-height: 50px;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.3;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  appearance: none;
  -webkit-appearance: none;
}

.input::placeholder {
  color: #a6adc6;
}

.input:hover,
.select:hover {
  border-color: var(--line-strong);
}

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(63, 106, 224, 0.14);
}

.select {
  padding-right: 42px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237982a6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px 18px;
}

.input[type="date"] {
  min-height: 50px;
  padding: 12px 13px;
  text-align: left;
}

.input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.55;
  cursor: pointer;
}

/* состояние ошибки */
.field.has-error .input,
.field.has-error .select,
.field.has-error .pad {
  border-color: var(--err);
  background: #fffafb;
}

.field.has-error .input:focus,
.field.has-error .select:focus {
  box-shadow: 0 0 0 4px rgba(224, 67, 92, 0.14);
}

.error-text {
  display: none;
  margin: 6px 0 0;
  color: var(--err);
  font-size: 12.5px;
  font-weight: 600;
}

.field.has-error .error-text {
  display: block;
}

/* ---------- Чипы (разряд, вид отпуска) ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 17px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease,
              box-shadow 0.15s ease, transform 0.12s ease;
}

.chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.chip:hover {
  border-color: var(--line-strong);
}

.chip:active {
  transform: scale(0.97);
}

.chip.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
  box-shadow: 0 0 0 3px rgba(63, 106, 224, 0.12);
}

.chip:focus-within {
  box-shadow: 0 0 0 4px rgba(63, 106, 224, 0.18);
}

/* ---------- Выбор типа документа ---------- */

.type-switch {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

@media (min-width: 480px) {
  .type-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 780px) {
  .type-switch {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* скрываем блок без потери значений в полях */
.is-hidden {
  display: none !important;
}

.type-option {
  position: relative;
  display: block;
  padding: 15px 16px 15px 52px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.type-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.type-option::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 17px;
  width: 20px;
  height: 20px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.type-option::after {
  content: "";
  position: absolute;
  left: 22px;
  top: 23px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform 0.16s ease;
}

.type-option:hover {
  border-color: var(--line-strong);
}

.type-option.is-active {
  border-color: var(--accent);
  background: linear-gradient(180deg, #f7f9ff 0%, #ffffff 100%);
  box-shadow: 0 0 0 3px rgba(63, 106, 224, 0.1);
}

.type-option.is-active::before {
  border-color: var(--accent);
}

.type-option.is-active::after {
  transform: scale(1);
}

.type-option:focus-within {
  box-shadow: 0 0 0 4px rgba(63, 106, 224, 0.16);
}

.t-title {
  display: block;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
}

.t-sub {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.35;
}

/* ---------- Блок «отпуск» ---------- */

.reveal {
  display: none;
  margin-top: 14px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: var(--card-soft);
}

.reveal.is-open {
  display: block;
  animation: fade-in 0.18s ease both;
}

.reveal-label {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-soft);
}

/* ---------- Период ---------- */

.days-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin-top: 2px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--card-soft);
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 600;
}

.days-badge.is-ok {
  background: var(--ok-soft);
  color: #0b7a53;
}

.days-badge.is-bad {
  background: var(--err-soft);
  color: #b0273f;
}

.days-badge.is-warn {
  background: #fff4e0;
  color: #965c00;
}

/* ---------- Медкомиссия (только после входа) ---------- */

.med-section {
  margin-top: 20px;
  padding: clamp(14px, 2vw, 20px);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #f7f9ff;
  scroll-margin-top: 18px;
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

.med-section .section-head {
  margin-bottom: 0;
}

.med-section.is-open .section-head {
  margin-bottom: 14px;
}

.med-head {
  align-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.med-toggle {
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.med-toggle:hover,
.med-toggle:focus-visible {
  background: var(--accent);
  color: #fff;
  outline: none;
}

.med-section.is-open .med-toggle {
  background: var(--accent);
  color: #fff;
}

.med-section .section-title {
  font-size: 16px;
}

.med-section.is-flash {
  animation: med-flash 1.6s ease;
}

.med-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px 18px;
}

.med-grid .field {
  flex: 0 1 260px;
  min-width: 220px;
}

.med-grid .days-badge {
  margin-bottom: 1px;
}

.med-actions {
  align-items: center;
}

.med-contacts {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.med-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink-soft);
  text-decoration: none;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease, transform 0.12s ease;
}

.med-icon-btn:hover,
.med-icon-btn:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.med-icon-btn:active {
  transform: translateY(1px);
}

.med-icon-btn.is-max {
  color: #4a5cf5;
}

.med-icon-btn.is-max:hover,
.med-icon-btn.is-max:focus-visible {
  border-color: #4a5cf5;
  background: #eef1ff;
  color: #4a5cf5;
}

.med-contact-hint {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.med-contact-hint b {
  font-weight: 700;
  color: var(--ink);
}

@keyframes med-flash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(63, 106, 224, 0); }
  25% { box-shadow: 0 0 0 4px rgba(63, 106, 224, 0.22); background: #f7f9ff; }
}

/* ---------- Подпись ---------- */

.pad-wrap {
  position: relative;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md);
  background:
    linear-gradient(#fff, #fff) padding-box,
    repeating-linear-gradient(0deg, transparent 0 0) border-box;
  overflow: hidden;
}

.pad {
  width: 100%;
  height: 168px;
  border: 0;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}

@media (min-width: 700px) {
  .pad {
    height: 190px;
  }
}

.pad-hint {
  position: absolute;
  inset: auto 0 42%;
  text-align: center;
  color: #a6adc6;
  font-size: 14px;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.pad-wrap.has-ink .pad-hint {
  opacity: 0;
}

.pad-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  padding: 0 22px;
  border: 1.5px solid transparent;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.16s ease, background 0.16s ease,
              border-color 0.16s ease, color 0.16s ease;
  -webkit-appearance: none;
  touch-action: manipulation;
}

.btn:active {
  transform: translateY(1px) scale(0.995);
}

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
  box-shadow: 0 14px 30px -12px rgba(63, 106, 224, 0.85);
}

.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink-soft);
}

.btn-ghost:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-sm {
  min-height: 42px;
  padding: 0 15px;
  font-size: 14px;
  font-weight: 650;
}

.btn-block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.72;
  cursor: progress;
  box-shadow: none;
}

.btn.is-loading .btn-label::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 9px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-top-color: #fff;
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin 0.7s linear infinite;
}

/* ---------- Боковая сводка ---------- */

.summary {
  display: none;
}

@media (min-width: 1000px) {
  .summary {
    display: block;
    position: sticky;
    top: 24px;
  }
}

.summary-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
}

.summary-sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12.5px;
}

.sum-list {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.sum-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}

.sum-row:last-child {
  border-bottom: 0;
}

.sum-key {
  flex: none;
  color: var(--muted);
  font-size: 13px;
}

.sum-val {
  text-align: right;
  color: var(--ink);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.sum-val.is-empty {
  color: #b4bbd2;
  font-weight: 500;
}

.sum-note {
  display: flex;
  gap: 9px;
  margin: 0;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--card-soft);
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.45;
}

.sum-note svg {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  stroke: var(--accent);
}

/* ---------- Мобильная панель действий ---------- */

.actionbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(11, 15, 40, 0.86);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.actionbar .btn {
  flex: 1;
  min-height: 52px;
}

.actionbar-info {
  display: none;
  flex: none;
  color: rgba(226, 232, 255, 0.72);
  font-size: 12px;
  line-height: 1.3;
  text-align: right;
}

@media (min-width: 480px) {
  .actionbar-info {
    display: block;
  }
}

@media (min-width: 1000px) {
  .actionbar {
    display: none;
  }
}

/* Пока панель закреплена внизу, последний блок страницы не должен
   уходить под неё */
@media (max-width: 999px) {
  body {
    padding-bottom: 88px;
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
}

/* ---------- Тост ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(92vw, 460px);
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: rgba(15, 21, 52, 0.96);
  color: #fff;
  font-size: 14px;
  font-weight: 550;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@media (min-width: 1000px) {
  .toast {
    bottom: 28px;
  }
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-error {
  background: rgba(150, 26, 46, 0.96);
}

.toast.is-ok {
  background: rgba(12, 107, 76, 0.96);
}

/* ---------- Подвал ---------- */

.footnote {
  margin: clamp(20px, 3vw, 30px) 0 0;
  color: rgba(214, 222, 250, 0.5);
  font-size: 12.5px;
  text-align: center;
  line-height: 1.6;
}

.footnote a {
  color: rgba(214, 222, 250, 0.8);
  text-decoration: none;
  border-bottom: 1px solid rgba(214, 222, 250, 0.28);
}

.footnote a:hover {
  color: #fff;
}

/* ---------- Мелочи ---------- */

/* атрибут hidden должен побеждать любые display-правила компонентов */
[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.checkbox {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
}

.checkbox input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

/* ---------- Вход через MAX ---------- */

.topbar {
  flex-wrap: wrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
}

.auth-area {
  display: flex;
  align-items: center;
}

.auth-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
}

.btn-auth {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
  -webkit-appearance: none;
  touch-action: manipulation;
}

.btn-auth:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.32);
}

.btn-auth:active {
  transform: scale(0.98);
}

.btn-auth-soft {
  background: rgba(107, 140, 255, 0.24);
  border-color: rgba(140, 168, 255, 0.38);
}

.btn-auth-ghost {
  background: transparent;
  color: rgba(232, 237, 255, 0.78);
}

@media (max-width: 899px) {
  .badge {
    display: none;
  }
}

@media (max-width: 559px) {
  .auth-name {
    display: none;
  }
}

@media (max-width: 430px) {
  .brand-sub {
    display: none;
  }
}

/* ---------- Модальные окна ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 25, 0.68);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 26px 24px 24px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 40px 80px -30px rgba(2, 5, 20, 0.75);
  animation: modal-in 0.18s ease both;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--card-soft);
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: var(--line);
}

.modal-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 11px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: var(--accent-grad);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.modal-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.modal-text {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.5;
}

.modal-code {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--card-soft);
  color: var(--ink-soft);
  font-size: 12.5px;
  text-align: center;
  word-break: break-all;
}

.modal-code b {
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.03em;
}

.modal-status {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.modal-status.is-error {
  color: var(--err);
  font-weight: 600;
}

.modal-status.is-ok {
  color: var(--ok);
  font-weight: 650;
}

body.modal-open {
  overflow: hidden;
}

/* ---------- История ---------- */

.history-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}

.history-item:last-child {
  border-bottom: 0;
}

.history-title {
  grid-column: 1;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.history-meta {
  grid-column: 1;
  color: var(--ink-soft);
  font-size: 12.5px;
}

.history-time {
  grid-column: 1;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.history-del {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.history-del:hover,
.history-del:focus-visible {
  color: var(--err);
  background: var(--err-soft);
  border-color: rgba(224, 67, 92, 0.25);
  outline: none;
}

.history-empty {
  margin: 4px 0 0;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--card-soft);
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}