/* ShireTech — free email security check (/email-check). Builds on main.css tokens. */

:root {
  --ec-good: #137a3f;      --ec-good-bg: #e6f5ec;
  --ec-warn: #8a5a00;      --ec-warn-bg: #fff4dc;  --ec-warn-line: #f0c75e;
  --ec-bad: #b42318;       --ec-bad-bg: #fdecea;
  --ec-info: var(--royal-500); --ec-info-bg: var(--tint-2);
}

/* Intro / form (on the navy hero) */
.ec-hero { padding: 64px 0 56px; }
.ec-hero-inner { position: relative; max-width: 760px; }
.ec-hero .eyebrow { color: var(--cyan-300); }
.ec-hero h1 { color: #fff; }
.ec-form { margin-top: 28px; }
.ec-form-label { display: block; font-weight: 600; color: #fff; margin-bottom: 8px; }
.ec-form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.ec-form-row input {
  flex: 1 1 260px; min-width: 0;
  font: inherit; font-size: 1.05rem; padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.35); border-radius: var(--radius);
  background: #fff; color: var(--ink);
}
.ec-btn-check { background: var(--cyan-400); color: #fff; border-color: var(--cyan-400); flex: 0 0 auto; }
.ec-btn-check:hover { background: var(--royal-500); border-color: var(--royal-500); color: #fff; }
.ec-btn-check[disabled], .ec-lead .btn[disabled] { opacity: 0.7; cursor: progress; }
.ec-hint { color: #cbd6ea; font-size: 0.9rem; margin: 10px 0 0; }
.ec-hero .ec-error { background: var(--ec-bad-bg); border-color: #f5b3ad; }

/* Shared focus + error styles */
.email-check-page input:focus-visible,
.email-check-page textarea:focus-visible,
.email-check-page .btn:focus-visible,
.email-check-page summary:focus-visible,
.email-check-page a:focus-visible {
  outline: 3px solid var(--cyan-400); outline-offset: 2px;
}
.ec-error {
  margin: 12px 0 0; padding: 10px 14px; border-radius: var(--radius);
  border: 1px solid #f5b3ad; background: var(--ec-bad-bg); color: var(--ec-bad);
  font-weight: 500; font-size: 0.95rem;
}

/* Results */
.ec-results-wrap { padding: 0 0 80px; background: var(--tint); }
.ec-results-wrap .container { max-width: 860px; }
.ec-status:not(:empty) {
  padding: 28px 0 0; color: var(--ink-soft); display: flex; align-items: center; gap: 10px;
}
.ec-spinner {
  width: 18px; height: 18px; border-radius: 50%; flex: 0 0 auto;
  border: 3px solid var(--line); border-top-color: var(--royal-500);
  animation: ec-spin 0.8s linear infinite;
}
@keyframes ec-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ec-spinner { animation: none; } }

.ec-result { padding-top: 40px; outline: none; scroll-margin-top: 100px; }
.ec-grade-card {
  display: flex; gap: 24px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow-sm);
}
.ec-grade {
  flex: 0 0 auto; width: 96px; height: 96px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Source Serif Pro', Georgia, serif; font-size: 3.4rem; font-weight: 700; line-height: 1;
  border: 3px solid currentColor;
}
.ec-grade-domain { margin: 0 0 2px; color: var(--muted); font-size: 0.92rem; word-break: break-all; }
.ec-verdict {
  margin: 0 0 4px; display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 1.25rem;
}
.ec-verdict svg { width: 22px; height: 22px; flex: 0 0 auto; }
.ec-verdict-text { margin: 0; color: var(--ink-soft); }

.is-good { color: var(--ec-good); }  .ec-grade.is-good { background: var(--ec-good-bg); }
.is-warn { color: var(--ec-warn); }  .ec-grade.is-warn { background: var(--ec-warn-bg); }
.is-bad  { color: var(--ec-bad); }   .ec-grade.is-bad  { background: var(--ec-bad-bg); }
.is-info { color: var(--ec-info); }

/* SPF / DMARC / DKIM rows */
.ec-summary { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 12px; }
.ec-row {
  display: grid; grid-template-columns: 7.5rem 1fr; gap: 6px 16px; align-items: start;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 20px;
}
.ec-row-name { font-weight: 700; color: var(--navy-800); }
.ec-row-name small { display: block; font-weight: 500; color: var(--muted); font-size: 0.8rem; line-height: 1.3; }
.ec-row-text { margin: 0; color: var(--ink-soft); }
.ec-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 0.85rem; margin-bottom: 4px;
}
.ec-pill svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* Problems + details */
.ec-h2 { font-size: 1.35rem; margin: 32px 0 12px; }
.ec-problems, .ec-findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ec-problem {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff; border: 1px solid var(--line); border-left: 4px solid currentColor;
  border-radius: var(--radius); padding: 12px 16px;
}
.ec-problem svg { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 3px; }
.ec-problem p { margin: 0; color: var(--ink); }
.ec-problem .ec-area { font-weight: 700; color: var(--navy-800); margin-right: 6px; }

.ec-details {
  margin-top: 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.ec-details summary {
  cursor: pointer; padding: 16px 20px; font-weight: 600; color: var(--navy-800); border-radius: var(--radius-lg);
}
.ec-details[open] summary { border-bottom: 1px solid var(--line); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.ec-details-intro { color: var(--muted); font-size: 0.92rem; margin: 14px 20px 12px; }
.ec-findings { padding: 0 20px 20px; }
.ec-finding { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.ec-finding-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 4px; }
.ec-finding-area {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--navy-800); background: var(--tint-2); padding: 2px 8px; border-radius: 4px;
}
.ec-finding p { margin: 0; }
.ec-fix {
  margin-top: 8px !important; font-size: 0.92rem; color: var(--ink-soft);
  background: var(--tint); border-radius: 4px; padding: 8px 10px;
  overflow-wrap: anywhere;
}
.ec-fix strong { color: var(--navy-800); }

/* CTA */
.ec-cta {
  margin-top: 40px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow-sm); border-top: 4px solid var(--cyan-400);
}
.ec-cta h2 { font-size: 1.5rem; }
.ec-cta-copy p { color: var(--ink-soft); }
.ec-lead { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.ec-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ec-field--wide { grid-column: 1 / -1; }
.ec-field label { font-weight: 600; font-size: 0.92rem; color: var(--navy-800); }
.ec-optional { font-weight: 400; color: var(--muted); }
.ec-field input, .ec-field textarea {
  font: inherit; padding: 10px 12px; border: 1px solid #b9c4d8; border-radius: var(--radius);
  background: #fff; color: var(--ink); width: 100%;
}
.ec-field textarea { resize: vertical; min-height: 84px; }
.ec-field input[aria-invalid="true"] { border-color: var(--ec-bad); }
.ec-lead .ec-error { margin: 0 0 12px; }
.ec-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.ec-lead-done {
  margin: 8px 0 0; padding: 14px 16px; border-radius: var(--radius); outline: none;
  background: var(--ec-good-bg); color: var(--ec-good); font-weight: 600;
}

@media (max-width: 600px) {
  .ec-hero { padding: 44px 0 40px; }
  .ec-form-row .btn { width: 100%; }
  .ec-grade-card { flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px; }
  .ec-grade { width: 80px; height: 80px; font-size: 2.8rem; }
  .ec-row { grid-template-columns: 1fr; padding: 14px 16px; }
  .ec-cta { padding: 20px; }
  .ec-lead { grid-template-columns: 1fr; }
  .ec-lead .btn { width: 100%; }
}
