/* ============================================================
   AdygnetID — переиспользуемые компоненты: кнопки, формы,
   hero, секции, карточки-фичи, алёрты, разделители.
   Зависит от theme.css. Подключать после base.css.
   ============================================================ */

/* — Кнопки — */
.btn-main,
.btn-soft {
  align-items: center;
  border-radius: var(--radius-pill);
  display: inline-flex;
  font-size: 14px;
  font-weight: 400;
  gap: 8px;
  justify-content: center;
  min-height: 36px;
  padding: 8px 16px;
  text-decoration: none;
  transition: transform .12s ease, border-color .12s ease, background-color .12s ease;
}

.btn-main {
  background: var(--blue);
  border: 1px solid var(--blue);
  color: #fff;
}

.btn-main:hover,
.btn-main:focus {
  background: var(--blue-focus);
  border-color: var(--blue-focus);
  color: #fff;
}

.btn-soft {
  background: var(--soft);
  border: 1px solid var(--soft-border);
  color: var(--ink);
}

.btn-soft:hover,
.btn-soft:focus {
  border-color: var(--blue);
  color: var(--blue);
}

.btn-main:active,
.btn-soft:active {
  transform: scale(.95);
}

.btn-main:disabled,
.btn-soft:disabled {
  opacity: .7;
  transform: none;
}

/* Видимое кольцо фокуса для клавиатуры (DESIGN.md) */
.btn-main:focus-visible,
.btn-soft:focus-visible {
  outline: 2px solid var(--primary-focus);
  outline-offset: 3px;
}

/* — Формы — */
.form-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 7px;
}

.form-control {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-size: 17px;
  min-height: 48px;
  padding: 11px 18px;
}

.form-control:focus {
  background: var(--panel);
  border-color: var(--blue-focus);
  box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--blue-focus) 18%, transparent);
  color: var(--ink);
}

.form-control::placeholder {
  color: var(--muted);
}

/* — Карточка авторизации — */
.login-card {
  background: var(--panel-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.auth-title {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
}

.auth-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.43;
  margin: 8px 0 22px;
}

.auth-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.auth-actions .btn-main,
.auth-actions .btn-soft {
  min-height: 44px;
  width: 100%;
}

/* — Карточка подтверждения (2FA / step-up) — */
.auth-card {
  background: var(--panel-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 36px);
}

.prompt-icon {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--icon-blue);
  display: flex;
  font-size: 28px;
  height: 58px;
  justify-content: center;
  margin-bottom: 18px;
  width: 58px;
}

.code-input {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .28em;
  text-align: center;
}

.link-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}

.link-row a { color: var(--blue); text-decoration: none; }
[data-theme="dark"] .link-row a { color: var(--icon-blue); }
.link-row span { color: var(--muted); font-size: 13px; }

/* — Разделитель «или» — */
.divider {
  align-items: center;
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 12px;
  grid-template-columns: 1fr auto 1fr;
  margin: 16px 0;
}

.divider::before,
.divider::after {
  background: var(--line);
  content: "";
  height: 1px;
}

/* — Алёрт — */
.alert-auth {
  background: color-mix(in srgb, var(--red) 10%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--red) 38%, var(--line));
  border-radius: var(--radius-lg);
  color: var(--red);
  display: flex;
  font-size: 14px;
  gap: 10px;
  line-height: 1.35;
  margin-top: 14px;
  padding: 12px 14px;
}

/* — Hero — */
.hero {
  background: var(--panel);
  min-height: min(720px, calc(100vh - 100px));
  padding: clamp(56px, 8vw, 96px) max(22px, calc((100vw - 1180px) / 2 + 22px));
}

[data-theme="dark"] .hero {
  background: #000;
}

.hero-grid {
  align-items: center;
  display: grid;
  gap: 48px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  margin: 0 auto;
  max-width: 1180px;
}

.hero-copy {
  max-width: 640px;
}

.hero-title {
  font-size: clamp(42px, 7vw, 64px);
  font-weight: 600;
  line-height: 1.05;
  margin: 0;
}

.hero-lead {
  color: var(--muted);
  font-size: clamp(19px, 2.4vw, 28px);
  line-height: 1.35;
  margin: 18px 0 0;
  max-width: 620px;
}

/* — Детальная секция / заголовок секции — */
.details {
  background: var(--bg);
  padding: clamp(48px, 6vw, 80px) max(22px, calc((100vw - 1180px) / 2 + 22px));
}

.section-title {
  margin: 0 auto 24px;
  max-width: 1180px;
}

.section-title h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
}

.section-copy {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.47;
  margin: 10px 0 0;
  max-width: 560px;
}

/* — Сетка карточек-фич — */
.feature-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 auto;
  max-width: 1180px;
}

.feature {
  background: var(--panel-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.ico {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--icon-blue);
  display: flex;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.feature-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.24;
  margin-top: 18px;
}

.feature-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.43;
  margin: 6px 0 0;
}

/* — Группы действий — */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.card-actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.card-actions .btn-main,
.card-actions .btn-soft {
  min-height: 44px;
  width: 100%;
}

/* — Статус-карточка (единый компонент для info/error/blocked-страниц) — */
.status-card {
  background: var(--panel-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.status-icon {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--icon-blue);
  display: flex;
  font-size: 24px;
  height: 56px;
  justify-content: center;
  margin-bottom: 18px;
  width: 56px;
}

.status-icon.danger {
  background: color-mix(in srgb, var(--red) 9%, var(--panel));
  border-color: color-mix(in srgb, var(--red) 32%, var(--line));
  color: var(--red);
}

.status-icon.success {
  background: color-mix(in srgb, var(--success) 12%, var(--panel));
  border-color: color-mix(in srgb, var(--success) 32%, var(--line));
  color: var(--success);
}

.status-icon.warning {
  background: color-mix(in srgb, var(--warning) 12%, var(--panel));
  border-color: color-mix(in srgb, var(--warning) 32%, var(--line));
  color: var(--warning);
}

.status-title {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
  margin: 0 0 8px;
}

.status-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.43;
  margin: 0;
}

.status-note {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.43;
  margin-top: 16px;
  overflow-wrap: anywhere;
  padding: 14px;
}

/* — Адаптив — */
@media (max-width: 980px) {
  .hero {
    min-height: auto;
    padding: 48px 14px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero-copy {
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-actions .btn-main,
  .hero-actions .btn-soft {
    width: 100%;
  }

  .login-card,
  .status-card {
    padding: 20px;
  }

  .auth-card {
    padding: 22px;
  }

  .details {
    padding: 48px 14px;
  }
}
