/* ===========================================================
   main.css — общие стили главной страницы сервиса проверки
   Дополняет Tailwind (подключён через CDN в index.html).
   Владелец файла: Фаза 1D.
   =========================================================== */

:root {
  --brand-50:  #ecfeff;
  --brand-100: #cffafe;
  --brand-200: #a5f3fc;
  --brand-500: #06b6d4;
  --brand-600: #0891b2;
  --brand-700: #0e7490;
  --brand-800: #155e75;
  --brand-900: #164e63;

  --ink-900: #0b1a2b;
  --ink-700: #243b53;
  --ink-500: #486581;
  --ink-300: #9fb3c8;
  --ink-100: #e4eaf1;
  --ink-50:  #f4f7fa;

  --ok:   #16a34a;
  --warn: #d97706;
  --bad:  #dc2626;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --shadow-soft: 0 10px 30px -12px rgba(8, 47, 73, 0.18), 0 4px 10px -4px rgba(8, 47, 73, 0.08);
  --shadow-elev: 0 30px 60px -20px rgba(8, 47, 73, 0.25);
}

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink-900);
  background: #fbfdff;
}

body {
  background-image:
    radial-gradient(1000px 600px at 85% -10%, rgba(6, 182, 212, 0.12), transparent 60%),
    radial-gradient(900px 600px at -10% 10%, rgba(14, 116, 144, 0.10), transparent 55%),
    linear-gradient(180deg, #fbfdff 0%, #f4f9fc 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* --- Заголовки: жирная, чуть сжатая типографика --- */
.h-display {
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.h-subtle {
  color: var(--ink-500);
  font-weight: 500;
  line-height: 1.55;
}

/* --- Карточка-плитка "стекло" --- */
.card-glass {
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.75) 100%);
  border: 1px solid rgba(14, 116, 144, 0.10);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
}

/* --- Поле URL --- */
.url-input {
  font-size: 1.125rem;
  padding: 1.15rem 1.35rem;
  border: 1.5px solid var(--ink-100);
  border-radius: var(--radius-md);
  width: 100%;
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
  color: var(--ink-900);
}
.url-input::placeholder { color: var(--ink-300); }
.url-input:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.18);
}
.url-input.is-invalid {
  border-color: var(--bad);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

/* --- Первичная кнопка --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 1.05rem 1.8rem;
  color: #fff;
  background: linear-gradient(180deg, var(--brand-500) 0%, var(--brand-700) 100%);
  border: 1px solid var(--brand-700);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 24px -10px rgba(8, 145, 178, 0.6), inset 0 1px 0 rgba(255,255,255,0.25);
  cursor: pointer;
  transition: transform 100ms ease, box-shadow 160ms ease, filter 160ms ease;
  white-space: nowrap;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.05); box-shadow: 0 14px 28px -10px rgba(8, 145, 178, 0.7), inset 0 1px 0 rgba(255,255,255,0.25); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 500;
  padding: 0.7rem 1.1rem;
  color: var(--ink-700);
  background: transparent;
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.btn-ghost:hover { background: #fff; border-color: var(--ink-300); color: var(--brand-700); }

/* --- Плитки преимуществ --- */
.feature-card {
  position: relative;
  padding: 1.75rem;
  background: #fff;
  border: 1px solid rgba(14, 116, 144, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.feature-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-elev); }
.feature-card .num {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-800));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- Блок прогресса --- */
.progress-panel {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 240ms ease, transform 240ms ease;
  pointer-events: none;
}
.progress-panel.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.progress-bar {
  position: relative;
  height: 12px;
  background: var(--ink-100);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar__fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--brand-500) 0%, var(--brand-700) 100%);
  transition: width 400ms cubic-bezier(.33,1,.68,1);
  border-radius: 999px;
}
.progress-bar__fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Ступени прогресса (init → crawling → technical → analyzing → report) */
.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.4rem;
  border-radius: var(--radius-sm);
  background: var(--ink-50);
  border: 1px solid transparent;
  color: var(--ink-500);
  font-size: 0.78rem;
  font-weight: 500;
  text-align: center;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}
.step .dot {
  width: 10px; height: 10px; border-radius: 999px;
  background: var(--ink-300);
  transition: background 160ms ease, transform 220ms ease;
}
.step.is-active {
  background: #fff;
  border-color: var(--brand-200);
  color: var(--brand-800);
  box-shadow: 0 2px 10px -4px rgba(6, 182, 212, 0.3);
}
.step.is-active .dot {
  background: var(--brand-600);
  transform: scale(1.25);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.18);
}
.step.is-done {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}
.step.is-done .dot { background: var(--ok); }

/* Живой лог статусов */
.status-log {
  max-height: 160px;
  overflow-y: auto;
  padding: 0.25rem 0;
}
.status-log__item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.35rem 0;
  font-size: 0.925rem;
  color: var(--ink-700);
  line-height: 1.5;
  opacity: 0;
  transform: translateY(-4px);
  animation: logIn 260ms ease forwards;
}
.status-log__item .bullet {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--brand-100);
  color: var(--brand-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  margin-top: 2px;
}
.status-log__item.is-current { color: var(--ink-900); font-weight: 500; }
.status-log__item.is-current .bullet { background: var(--brand-600); color: #fff; }
@keyframes logIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Спиннер для текущего статуса */
.spinner {
  width: 18px; height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(6, 182, 212, 0.2);
  border-top-color: var(--brand-600);
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
  margin-top: 1px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Сообщения об ошибках */
.alert {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid;
  align-items: flex-start;
  font-size: 0.95rem;
  line-height: 1.5;
}
.alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.alert-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e3a8a;
}

/* Иконки в плитках */
.icon-chip {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-50);
  color: var(--brand-700);
  flex-shrink: 0;
}

/* Утилиты */
.divider-soft {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(14, 116, 144, 0.15), transparent);
  border: 0;
}

.link-quiet {
  color: var(--ink-500);
  text-decoration: none;
  border-bottom: 1px dashed var(--ink-300);
  transition: color 140ms ease, border-color 140ms ease;
}
.link-quiet:hover { color: var(--brand-700); border-color: var(--brand-500); }

.badge-mock {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* Адаптив */
@media (max-width: 640px) {
  .url-input { font-size: 1rem; padding: 1rem 1.1rem; }
  .btn-primary { width: 100%; padding: 1rem 1.2rem; font-size: 1rem; }
  .steps { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .step { font-size: 0.68rem; padding: 0.4rem 0.25rem; }
  .feature-card { padding: 1.25rem; }
}

/* Клавишная навигация */
:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Prefer-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
