html, body {
  height: 100%;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f5f7fa 0%, #eef2f6 100%);
  color: #1f2937;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.page-shell {
  min-height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 16px;
}

.mail-card {
  width: 100%;
  max-width: 860px;
  background: #ffffff;
  border: 1px solid #dde3ea;
  border-radius: 12px;
  padding: 28px 24px;
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.08);
}

.domain-card {
  max-width: 1040px;
}

.top-action-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.top-action-bar-wrap {
  gap: 8px;
  flex-wrap: wrap;
}

.mail-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
}

.mail-subtitle {
  margin: 8px 0 24px;
  color: #4b5563;
}

.form-control:focus,
.form-check-input:focus,
.btn:focus {
  box-shadow: 0 0 0 0.18rem rgba(13, 110, 253, 0.2);
}

.analysis-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.95rem;
  color: #4b5563;
}

.domain-table thead th {
  background: #f3f4f6;
  border-bottom-color: #d9dde3;
  font-weight: 700;
}

.domain-table tbody tr td {
  vertical-align: middle;
}

.status-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.status-pass {
  background: #e9f9ef;
  color: #1f8f42;
}

.status-warn {
  background: #fff6e8;
  color: #cc8200;
}

.status-fail {
  background: #ffecec;
  color: #cf2e2e;
}

.status-info {
  background: #eaf2ff;
  color: #1967d2;
}

.mail-form.is-submitting {
  opacity: 0.96;
}

.mail-form.is-submitting .form-control,
.mail-form.is-submitting .form-check-input {
  background-color: #eef3fb;
  cursor: not-allowed;
}

.submit-feedback {
  border: 1px solid #dce8ff;
  background: linear-gradient(135deg, #f7faff 0%, #eef5ff 100%);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: inset 0 1px 0 #ffffff, 0 8px 16px rgba(54, 96, 178, 0.08);
}

.submit-feedback-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: #1f4f9d;
}

.submit-feedback-text {
  color: #355681;
  font-size: 0.92rem;
}

.submit-feedback-state {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  font-size: 0.75rem;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.submit-feedback-state.in-progress {
  background: #e4efff;
  color: #1f4f9d;
}

.submit-feedback-state.success {
  background: #e8f9ef;
  color: #1f8f42;
}

.submit-feedback-state.error {
  background: #fdeaea;
  color: #cf2e2e;
}

.submit-feedback-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: grid;
  gap: 7px;
}

.submit-feedback-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #355681;
  font-size: 0.9rem;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #bccbe4;
  flex-shrink: 0;
}

.submit-feedback-steps li.running .step-dot {
  background: #0d6efd;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.2);
  animation: pulse 1.2s ease-in-out infinite;
}

.submit-feedback-steps li.success .step-dot {
  background: #1f8f42;
}

.submit-feedback-steps li.error .step-dot {
  background: #cf2e2e;
}

.submit-feedback-steps li.pending {
  opacity: 0.9;
}

.submit-feedback-errors {
  border: 1px solid #f3c7c7;
  background: #fff4f4;
  border-radius: 10px;
  padding: 10px 12px;
}

.submit-feedback-errors-title {
  font-weight: 700;
  color: #9f1f1f;
  margin-bottom: 6px;
}

.submit-feedback-errors ul {
  margin: 0;
  padding-left: 18px;
  color: #7f1d1d;
  font-size: 0.9rem;
}

.submit-feedback-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #dfe9fb;
  overflow: hidden;
}

.submit-feedback-bar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6 0%, #0d6efd 100%);
  opacity: 0.35;
}

.submit-feedback.is-loading .submit-feedback-bar {
  width: 34%;
  opacity: 1;
  animation: progress-glide 1.4s ease-in-out infinite;
}

.submit-feedback.is-success .submit-feedback-bar {
  opacity: 0.75;
  background: linear-gradient(90deg, #41b66f 0%, #1f8f42 100%);
}

.submit-feedback.is-error .submit-feedback-bar {
  opacity: 0.75;
  background: linear-gradient(90deg, #e25555 0%, #cf2e2e 100%);
}

.site-score {
  border: 1px solid #dbe6f7;
  background: #f8fbff;
  border-radius: 12px;
  padding: 10px 12px;
}

.site-score-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.site-score-track {
  width: 100%;
  height: 10px;
  background: #dfe8f7;
  border-radius: 999px;
  overflow: hidden;
}

.site-score-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.score-good {
  background: linear-gradient(90deg, #52c67c 0%, #1f8f42 100%);
}

.score-mid {
  background: linear-gradient(90deg, #ffbf5f 0%, #e39a28 100%);
}

.score-low {
  background: linear-gradient(90deg, #ef6767 0%, #cf2e2e 100%);
}

.site-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.site-info-card {
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.site-info-title {
  font-size: 1rem;
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid #e6edf7;
  background: #f8fbff;
  font-weight: 700;
}

.site-key {
  width: 38%;
  font-weight: 600;
  color: #334155;
}

.ua-string {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.72rem;
  color: #475569;
  word-break: break-all;
}

.ua-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.ua-pill-ok {
  background: #e7f8ee;
  color: #1f8f42;
}

.ua-pill-warn {
  background: #fff1f1;
  color: #cf2e2e;
}

.live-analysis {
  border: 1px solid #dce6f4;
  border-radius: 14px;
  background: linear-gradient(180deg, #fcfdff 0%, #f4f8ff 100%);
  padding: 14px;
  box-shadow: inset 0 1px 0 #ffffff;
}

.live-analysis-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.live-analysis-title {
  font-size: 1.06rem;
  font-weight: 700;
}

.live-analysis-sub {
  color: #475569;
  font-size: 0.92rem;
}

.live-progress-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: 30px;
  border-radius: 999px;
  background: #e8f0ff;
  color: #1d4ed8;
  font-size: 0.82rem;
  font-weight: 700;
}

.live-progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #dbe7fd;
}

.live-progress-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  width: 0%;
  background: linear-gradient(90deg, #60a5fa 0%, #2563eb 100%);
  box-shadow: 0 0 0 1px rgba(30, 64, 175, 0.12) inset;
  transition: width 0.35s ease;
}

.live-reveal {
  animation: card-in 0.45s ease;
}

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

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

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.28);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(13, 110, 253, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
  }
}

@keyframes progress-glide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

@media (max-width: 767px) {
  .mail-card {
    padding: 22px 14px;
  }

  .site-info-grid {
    grid-template-columns: 1fr;
  }

  .live-analysis {
    padding: 12px 10px;
  }

  .live-analysis-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .live-progress-badge {
    min-width: 48px;
    height: 27px;
    font-size: 0.76rem;
  }

  .domain-table {
    font-size: 0.84rem;
  }
}
