/* Minimal styling for the Phase 1 status page.
   Real branding (admin-set name, logo, primary color) arrives in Phase 8. */

:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --accent: #2563eb;
  --ok: #047857;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.card {
  max-width: 560px;
  width: 100%;
  background: var(--card);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06);
}

h1 { margin: 0 0 0.5rem; font-size: 1.6rem; }
h2 { font-size: 1rem; margin: 1.5rem 0 0.5rem; color: var(--muted); }

.badge {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(4, 120, 87, 0.12);
  color: var(--ok);
  font-size: 0.8rem;
  font-weight: 600;
}

p { line-height: 1.55; color: var(--text); }

.tables { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tables li { margin: 0; }

code {
  background: #eef2ff;
  color: var(--accent);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

.env { margin-top: 1.5rem; color: var(--muted); font-size: 0.85rem; }

/* ----- Install wizard / forms ----- */
.card--wide { max-width: 640px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.hint { color: var(--muted); font-weight: 400; font-size: 0.8rem; }

fieldset {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1rem 1.25rem 1.25rem;
  margin: 0 0 1.25rem;
}
legend { font-weight: 600; padding: 0 0.4rem; color: var(--accent); }

label {
  display: block;
  margin: 0.75rem 0;
  font-size: 0.9rem;
  font-weight: 600;
}
label.checkbox { font-weight: 400; display: flex; align-items: center; gap: 0.5rem; }

input[type="email"],
input[type="password"],
input[type="text"] {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}
input[type="color"] { margin-top: 0.35rem; width: 60px; height: 36px; border: 1px solid #cbd5e1; border-radius: 8px; }

input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { filter: brightness(0.95); }

.alert {
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
}
.alert--error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert--ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; }
.alert ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }

/* ----- Top navigation (authenticated layout) ----- */
body.has-nav { display: block; align-items: initial; }
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--card);
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.navlinks { display: flex; align-items: center; gap: 1rem; font-size: 0.9rem; }
.navlinks a { color: var(--accent); text-decoration: none; }
.navlinks a:hover { text-decoration: underline; }
.who { color: var(--muted); font-size: 0.85rem; }
.tag {
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.inline { display: inline; margin: 0; }
.linkbtn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.linkbtn:hover { text-decoration: underline; }

/* Centered content column for the auth pages. */
.container {
  max-width: 640px;
  margin: 2rem auto;
  padding: 0 1.25rem;
}
.container .card { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06); margin-bottom: 1.25rem; }

textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
}
input[type="file"], input[type="search"], select { font: inherit; }

.btn--ghost { background: transparent; color: var(--accent); border: 1px solid #cbd5e1; }
.btn--ghost:hover { background: #f1f5f9; filter: none; }

/* ----- Dashboard tiles ----- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.tile { display: block; padding: 1rem; border: 1px solid #e5e7eb; border-radius: 10px; text-decoration: none; color: var(--text); background: #fff; }
.tile:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.tile h3 { margin: 0 0 0.25rem; color: var(--accent); }

/* ----- Status badges ----- */
.badge--valid { background: rgba(4,120,87,0.12); color: #047857; }
.badge--invalid { background: rgba(185,28,28,0.12); color: #b91c1c; }
.badge--catchall { background: rgba(217,119,6,0.14); color: #b45309; }
.badge--unknown { background: rgba(107,114,128,0.15); color: #4b5563; }
.badge--risky { background: rgba(234,88,12,0.14); color: #c2410c; }

/* ----- Flag chips ----- */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0; }
.chip { background: #eef2ff; color: var(--accent); border-radius: 999px; padding: 0.1rem 0.6rem; font-size: 0.78rem; font-weight: 600; }
.chip--bad { background: #fef2f2; color: #b91c1c; }
.chip--warn { background: #fffbeb; color: #b45309; }
.chip--ok { background: #ecfdf5; color: #047857; }

/* ----- Result breakdown ----- */
.result-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.score { color: var(--muted); font-size: 0.9rem; }
.result-email { margin: 0.25rem 0 0.5rem; }
.alert--warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
table.kv { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
table.kv th { text-align: left; width: 90px; vertical-align: top; padding: 0.35rem 0.5rem 0.35rem 0; color: var(--muted); font-weight: 600; }
table.kv td { padding: 0.35rem 0; border-bottom: 1px solid #f1f5f9; }
.ok { color: #047857; font-weight: 600; }
.bad { color: #b91c1c; font-weight: 600; }

/* ----- Data table (bulk / history) ----- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin-top: 0.75rem; }
table.data th, table.data td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid #eef2f7; vertical-align: top; }
table.data thead th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.02em; }
.flagcell { white-space: nowrap; }
.smtpcell .hint { display: inline; }

/* ----- Progress bar ----- */
.progress { background: #e5e7eb; border-radius: 999px; height: 12px; overflow: hidden; margin: 0.75rem 0 0.25rem; }
.progress-bar { background: var(--accent); height: 100%; width: 0; transition: width 0.4s ease; }
.progress-text { color: var(--muted); font-size: 0.85rem; margin: 0; }

/* ----- Filters / pager ----- */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
.filters input[type="search"] { flex: 1 1 200px; padding: 0.45rem 0.6rem; border: 1px solid #cbd5e1; border-radius: 8px; }
.filters select { padding: 0.45rem 0.6rem; border: 1px solid #cbd5e1; border-radius: 8px; }
.pager { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; }

/* ----- Branding logo in nav ----- */
.brand-logo { max-height: 28px; max-width: 160px; vertical-align: middle; display: block; }

/* ----- Admin sub-navigation ----- */
.subnav { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.5rem 0 1rem; border-bottom: 1px solid #e5e7eb; }
.subnav a {
  padding: 0.4rem 0.7rem;
  text-decoration: none;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  font-size: 0.9rem;
}
.subnav a:hover { color: var(--accent); }
.subnav a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ----- Admin inline action forms ----- */
td.actions { white-space: normal; }
.inline-form { display: inline-flex; align-items: center; gap: 0.25rem; margin: 0.15rem 0.4rem 0.15rem 0; }
.inline-form .mini { width: 110px; padding: 0.25rem 0.4rem; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 0.8rem; margin: 0; }
.linkbtn.danger { color: #b91c1c; }
.row-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin: 0.75rem 0; }
.row-actions .inline-form input[type="text"] { width: 220px; padding: 0.4rem 0.5rem; border: 1px solid #cbd5e1; border-radius: 6px; margin: 0; }

/* ----- Logo preview (branding page) ----- */
.logo-preview { margin: 0.5rem 0; }
.logo-preview img { max-height: 64px; max-width: 240px; border: 1px solid #e5e7eb; border-radius: 8px; padding: 4px; background: #fff; }
