/* =========================================
   WEBTEST LAB — ОСНОВНЫЕ СТИЛИ
========================================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f4f7fb;
  color: #253247;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

.app-container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 24px;
}

/* =========================================
   ШАПКА
========================================= */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 28px;
  border-bottom: 1px solid #e3eaf2;
  margin-bottom: 30px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, #477cf5, #65a5ff);
  color: white;
  border-radius: 16px;
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 5px 14px rgba(71, 124, 245, 0.2);
}

.logo-text h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 750;
  color: #1e293b;
}

.logo-text p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #7b8799;
}

/* =========================================
   ВСТУПИТЕЛЬНЫЙ БЛОК
========================================= */

.intro {
  margin-bottom: 25px;
}

.intro h2 {
  font-size: 27px;
  margin: 0 0 10px;
  color: #1e293b;
}

.intro p {
  color: #718096;
  font-size: 15px;
  margin: 0;
  max-width: 760px;
}

/* =========================================
   ФОРМА ВВОДА URL
========================================= */

.form-section {
  background: #ffffff;
  border: 1px solid #e5ebf3;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: 0 4px 18px rgba(31, 53, 85, 0.035);
}

.form-section label {
  display: block;
  font-weight: 650;
  font-size: 14px;
  margin-bottom: 10px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row input {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 13px 16px;
  border: 1px solid #dce5ef;
  border-radius: 10px;
  outline: none;
  background: #ffffff;
  color: #26354b;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.form-row input::placeholder {
  color: #a3afbf;
}

.form-row input:focus {
  border-color: #6091fa;
  box-shadow: 0 0 0 3px rgba(96, 145, 250, 0.12);
}

.form-row button {
  flex-shrink: 0;
  padding: 13px 22px;
  background: #477cf5;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-weight: 650;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.15s;
}

.form-row button:hover {
  background: #3569e6;
}

.form-row button:active {
  transform: scale(0.98);
}

.form-section small {
  display: block;
  margin-top: 10px;
  color: #8592a5;
  font-size: 12px;
}

/* =========================================
   УВЕДОМЛЕНИЯ И ОШИБКИ
========================================= */

.alert {
  padding: 15px 18px;
  border-radius: 11px;
  margin: 18px 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.alert-error {
  color: #b42332;
  background: #fff0f1;
  border: 1px solid #ffd7dc;
}

.alert-warning {
  color: #9a6700;
  background: #fff8e5;
  border: 1px solid #ffe4a6;
}

.alert-success {
  color: #167447;
  background: #eaf8ef;
  border: 1px solid #c9edd7;
}

/* =========================================
   ОСНОВНОЙ БЛОК РЕЗУЛЬТАТОВ
========================================= */

.result-section {
  background: #ffffff;
  border: 1px solid #e3eaf2;
  border-radius: 17px;
  padding: 25px;
  margin-top: 25px;
  box-shadow: 0 5px 22px rgba(31, 53, 85, 0.04);
}

.result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.result-heading h2 {
  margin: 0;
  font-size: 21px;
  color: #26354b;
}

.result-url {
  margin: 0 0 23px;
  color: #718096;
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* =========================================
   СТАТУСЫ
========================================= */

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.success {
  background: #e5f7ec;
  color: #19804b;
}

.status-badge.warning {
  background: #fff4d6;
  color: #a16b00;
}

.status-badge.error {
  background: #ffebed;
  color: #c02d3a;
}

.status-badge.neutral {
  background: #eef2f7;
  color: #627187;
}

/* =========================================
   КАРТОЧКИ СТАТИСТИКИ
========================================= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 24px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 108px;
  padding: 18px;
  border: 1px solid #e7edf5;
  border-radius: 13px;
  background: #fbfcfe;
}

.stat-card span {
  color: #77869a;
  font-size: 13px;
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 25px;
  font-weight: 750;
  color: #29384e;
  overflow-wrap: anywhere;
}

/* =========================================
   ИНФОРМАЦИЯ О СТРАНИЦЕ
========================================= */

.info-card,
.checks-card {
  border: 1px solid #e5ebf3;
  border-radius: 13px;
  padding: 20px;
  margin-bottom: 22px;
  background: #ffffff;
}

.info-card h3,
.checks-card h3,
.link-report h3 {
  font-size: 17px;
  color: #29384e;
  margin: 0 0 17px;
}

.info-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid #eff3f7;
}

.info-row:last-child {
  border-bottom: none;
}

.info-row span {
  color: #748297;
  font-size: 13px;
}

.info-row strong {
  text-align: right;
  color: #34445b;
  font-size: 13px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

/* =========================================
   СПИСОК ПРОВЕРОК
========================================= */

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 15px 0;
  border-bottom: 1px solid #edf1f6;
}

.check-item:last-child {
  border-bottom: none;
}

.check-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
}

.check-icon.success {
  color: #19804b;
  background: #e5f7ec;
}

.check-icon.warning {
  color: #a16b00;
  background: #fff4d6;
}

.check-icon.error {
  color: #c02d3a;
  background: #ffebed;
}

.check-icon.neutral {
  color: #627187;
  background: #eef2f7;
}

.check-content {
  flex: 1;
  min-width: 0;
}

.check-content strong {
  display: block;
  color: #34445b;
  font-size: 14px;
  margin-bottom: 4px;
}

.check-content p {
  margin: 0;
  color: #7a879a;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.check-status {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  padding-top: 4px;
}

.check-status.success {
  color: #19804b;
}

.check-status.warning {
  color: #a16b00;
}

.check-status.error {
  color: #c02d3a;
}

.check-status.neutral {
  color: #627187;
}

/* =========================================
   ОТЧЕТ ПО ВНУТРЕННИМ СТРАНИЦАМ
========================================= */

.link-report {
  margin-top: 25px;
  padding: 23px;
  background: #ffffff;
  border: 1px solid #e3eaf2;
  border-radius: 15px;
}

.link-report h3 {
  margin-bottom: 20px;
}

.link-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.link-summary-card {
  border: 1px solid #e5ebf3;
  border-radius: 11px;
  padding: 16px;
  background: #fbfcfe;
}

.link-summary-card span {
  display: block;
  font-size: 13px;
  color: #758398;
  margin-bottom: 8px;
}

.link-summary-card strong {
  font-size: 24px;
  font-weight: 750;
  color: #29384e;
}

.text-success {
  color: #19804b !important;
}

.text-error {
  color: #c02d3a !important;
}

/* =========================================
   ПРЕДУПРЕЖДЕНИЕ ОБ ОГРАНИЧЕНИИ ОБХОДА
========================================= */

.crawl-notice {
  padding: 14px 16px;
  margin-bottom: 18px;
  border-radius: 10px;
  background: #fff7df;
  border: 1px solid #ffe6a6;
  color: #916400;
  font-size: 13px;
}

/* =========================================
   ТАБЛИЦА ВНУТРЕННИХ СТРАНИЦ
========================================= */

.link-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e8edf4;
  border-radius: 10px;
}

.link-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  background: #ffffff;
}

.link-table thead {
  background: #f7f9fc;
}

.link-table th {
  text-align: left;
  padding: 14px;
  color: #738197;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 1px solid #e8edf4;
}

.link-table td {
  padding: 14px;
  border-bottom: 1px solid #edf1f6;
  color: #44536a;
  font-size: 13px;
  vertical-align: middle;
}

.link-table tbody tr:last-child td {
  border-bottom: none;
}

.link-table tbody tr:hover {
  background: #fbfcfe;
}

.url-cell {
  min-width: 240px;
  max-width: 420px;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: #477cf5 !important;
}

/* =========================================
   СТАТУСЫ СТРАНИЦ
========================================= */

.table-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.table-status.success {
  background: #e5f7ec;
  color: #19804b;
}

.table-status.error {
  background: #ffebed;
  color: #c02d3a;
}

.table-status.warning {
  background: #fff4d6;
  color: #a16b00;
}

.error-details td {
  background: #fff8f8;
  color: #bd3542;
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* =========================================
   ПОДВАЛ
========================================= */

.footer {
  padding: 25px 10px 10px;
  text-align: center;
  color: #94a0b1;
  font-size: 12px;
}

/* =========================================
   АДАПТИВНОСТЬ ДЛЯ ПЛАНШЕТОВ
========================================= */

@media (max-width: 900px) {
  .app-container {
    padding: 24px 18px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================
   АДАПТИВНОСТЬ ДЛЯ ТЕЛЕФОНОВ
========================================= */

@media (max-width: 600px) {
  .app-container {
    padding: 17px 12px;
  }

  .header {
    padding-bottom: 20px;
    margin-bottom: 23px;
  }

  .logo {
    gap: 11px;
  }

  .logo-icon {
    width: 46px;
    height: 46px;
    font-size: 17px;
    border-radius: 13px;
  }

  .logo-text h1 {
    font-size: 21px;
  }

  .logo-text p {
    font-size: 11px;
  }

  .intro h2 {
    font-size: 23px;
  }

  .intro p {
    font-size: 14px;
  }

  .form-section {
    padding: 17px;
  }

  .form-row {
    flex-direction: column;
  }

  .form-row button {
    width: 100%;
  }

  .result-section {
    padding: 17px;
  }

  .result-heading h2 {
    font-size: 19px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-card {
    min-height: 92px;
    padding: 14px;
  }

  .stat-card strong {
    font-size: 22px;
  }

  .info-card,
  .checks-card {
    padding: 16px;
  }

  .info-row {
    flex-direction: column;
    gap: 5px;
  }

  .info-row strong {
    text-align: left;
  }

  .check-item {
    flex-wrap: wrap;
  }

  .check-status {
    margin-left: 40px;
  }

  .link-report {
    padding: 15px;
  }

  .link-summary {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .link-summary-card {
    padding: 14px;
  }

  .link-table th,
  .link-table td {
    padding: 11px;
  }
}

/* =========================================
   ДОСТУПНОСТЬ
========================================= */

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(71, 124, 245, 0.35);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
