/* Tech 360 Solutions — Email Security Checker
   Palette per Tech360 Brand Guidelines v1.0 (June 2026):
   Dark Blue #183883 (primary), Medium Blue #0C5CA1 (links/subheads),
   Light Blue #1CA3E4 (graphic accent only — never text on white),
   Ink #1A1A1A, Slate Gray #555555, Light Wash #EAF4FB,
   accents: Brand Gold #836218, Burnt Orange #A1510C, Signal Orange #E55E1C */

:root {
  --navy: #183883;   /* Dark Blue */
  --blue: #0c5ca1;   /* Medium Blue */
  --sky: #1ca3e4;    /* Light Blue — graphic accent only */
  --ink: #1a1a1a;
  --muted: #555555;  /* Slate Gray */
  --bg: #eaf4fb;     /* Light Wash */
  --card-bg: #ffffff;
  --border: #d5e3ef;

  --gold: #836218;   /* Brand Gold */
  --burnt: #a1510c;  /* Burnt Orange */
  --signal: #e55e1c; /* Signal Orange */

  --pass: #1a7f37;
  --pass-bg: #e6f4ea;
  --warn: #a1510c;   /* Burnt Orange, AA on white */
  --warn-bg: #fdf3e1;
  --fail: #b42318;
  --fail-bg: #fdecea;
  --undet: #52606d;
  --undet-bg: #eef1f4;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  /* Brand body face: Open Sans / Source Sans, Calibri/Arial fallbacks.
     Fonts render when locally available; nothing is loaded externally (CSP). */
  font-family: "Open Sans", "Source Sans 3", Calibri, "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Large base size: readable when projected on a screen */
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- header ---------- */

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: center;
}

.logo { height: 56px; width: auto; display: block; }

/* ---------- hero ---------- */

main { max-width: 880px; margin: 0 auto; padding: 0 1.25rem 3rem; }

.hero { text-align: center; padding: 2.5rem 0 1.5rem; }

h1, h2, h3, #check-button {
  /* Brand heading face: Montserrat, Calibri/Arial Bold fallbacks */
  font-family: Montserrat, Calibri, "Segoe UI", Arial, sans-serif;
}

.hero h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.7rem);
  line-height: 1.2;
  color: var(--navy);
  margin: 0 0 1rem;
}

/* Medium Blue, not Light Blue: the guidelines bar Light Blue text on light
   backgrounds (fails contrast). */
.hero h1 em { color: var(--blue); font-style: italic; }

.hero-sub {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 44rem;
  margin: 0 auto 1.25rem;
}

.hero-note {
  font-size: 1.05rem;
  color: var(--ink);
  max-width: 42rem;
  margin: 0 auto 2rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 5px solid var(--sky);
  border-radius: 0 10px 10px 0;
  padding: 0.8rem 1.1rem;
  text-align: left;
}

.check-form {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

#domain-input {
  font-size: 1.3rem;
  padding: 0.8rem 1.1rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  width: min(26rem, 100%);
  color: var(--ink);
  background: #fff;
}

#domain-input:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 4px rgba(28, 163, 228, 0.18);
}

#check-button {
  font-size: 1.2rem;
  font-weight: 600;
  padding: 0.8rem 1.6rem;
  border: none;
  border-radius: 12px;
  background: var(--navy); /* solid Dark Blue per guidelines: primary buttons */
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}

#check-button:hover:not(:disabled) { background: var(--blue); }
#check-button:disabled { opacity: 0.65; cursor: wait; }

.input-note {
  margin: 1.25rem auto 0;
  max-width: 44rem;
  background: var(--warn-bg);
  border: 1px solid #f0d9a8;
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  font-size: 1rem;
  text-align: left;
}

.link-button {
  background: none;
  border: none;
  color: var(--blue);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

/* ---------- grade banner ---------- */

.results { padding-top: 1.5rem; }

.grade-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.grade-loading { font-size: 1.15rem; color: var(--muted); }

.grade {
  flex: 0 0 auto;
  width: 84px; height: 84px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.grade-letter { font-size: 2.6rem; font-weight: 800; line-height: 1; }

.grade-A { background: var(--pass); }
.grade-B { background: #4d8f2f; }
.grade-C { background: var(--gold); }
.grade-D { background: var(--burnt); }
.grade-F { background: var(--fail); }
.grade-unknown { background: var(--undet); }

.grade-summary { font-size: 1.2rem; font-weight: 600; margin: 0 0 0.35rem; }

/* tooltip */

.tooltip-wrap { position: relative; display: inline-block; }

.tooltip-trigger {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 0.95rem;
  text-decoration: underline dotted;
  cursor: help;
  padding: 0;
}

.tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  z-index: 10;
  width: min(24rem, 80vw);
  background: var(--ink);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.5;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.tooltip-wrap:hover .tooltip,
.tooltip-trigger:focus + .tooltip { display: block; }

/* ---------- cards ---------- */

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card.loading .loading-text { color: var(--muted); }

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card h2 { margin: 0; color: var(--navy); font-size: 1.5rem; }

.card-subtitle { margin: 0.25rem 0 0; color: var(--muted); font-size: 1rem; }

.badge {
  flex: 0 0 auto;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-pass { background: var(--pass-bg); color: var(--pass); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-fail { background: var(--fail-bg); color: var(--fail); }
.badge-undetermined { background: var(--undet-bg); color: var(--undet); }

.meta { color: var(--muted); font-size: 1rem; margin: 0.4rem 0; }

/* raw records */

.record-block {
  position: relative;
  margin: 0.75rem 0 1rem;
}

.record-block pre {
  margin: 0;
  background: #0f172a;
  color: #d9e6f7;
  border-radius: 10px;
  padding: 1rem 4.5rem 1rem 1.1rem; /* right padding clears the Copy button */
  overflow-x: auto;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

.record-block code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.copy-button {
  position: absolute;
  top: 8px; right: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.12);
  color: #d9e6f7;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
}

.copy-button:hover { background: rgba(255, 255, 255, 0.22); }

/* findings */

.findings { list-style: none; margin: 1rem 0 0; padding: 0; }

.finding {
  border-left: 5px solid var(--undet);
  background: var(--undet-bg);
  border-radius: 0 10px 10px 0;
  padding: 0.8rem 1rem;
  margin-bottom: 0.75rem;
  font-size: 1.02rem;
}

.finding p { margin: 0; }
.finding .fix { margin-top: 0.5rem; }

.finding-good { border-color: var(--pass); background: var(--pass-bg); }
.finding-warn { border-color: var(--warn); background: var(--warn-bg); }
.finding-bad  { border-color: var(--fail); background: var(--fail-bg); }
.finding-info { border-color: var(--sky); background: var(--bg); }

/* collapsible explainer */

.why-details {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  background: var(--bg);
}

.why-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--blue);
}

/* ---------- bottom explainer ---------- */

.explainer { padding-top: 2.5rem; }

.explainer h2 { color: var(--navy); text-align: center; }

.explainer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.explainer-grid > div {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.25rem;
}

.explainer-grid h3 { margin: 0 0 0.4rem; color: var(--blue); }
.explainer-grid p { margin: 0; font-size: 1rem; color: var(--muted); }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: #fff;
  text-align: center;
  padding: 2rem 1.25rem 2.5rem;
  margin-top: 2rem;
}

.footer-logo { height: 44px; width: auto; margin-bottom: 0.5rem; }

.site-footer p { margin: 0.3rem 0; }

.site-footer a { color: var(--blue); font-weight: 600; }

/* Tagline in Medium Blue italic, per the brand signature format */
.site-footer .tagline { color: var(--blue); font-style: italic; font-size: 1rem; }

.disclaimer {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 40rem;
  margin: 0.75rem auto 0 !important;
}

/* ---------- mobile ---------- */

@media (max-width: 560px) {
  body { font-size: 17px; }
  .check-form { flex-direction: column; align-items: stretch; }
  #check-button { width: 100%; }
  .card-header { flex-direction: column; }
  .grade-banner { flex-direction: column; text-align: center; }
  .tooltip { left: 50%; transform: translateX(-50%); }
}
