/* Shared styles for ORCaddy secondary pages (enterprise, contact, admin).
   Tokens and base components mirror index.html. */
:root {
  --primary: #2F5273;
  --primary-dark: #243F59;
  --primary-light: #5B7FA0;
  --primary-tint: #E9EFF5;
  --accent: #0F766E;
  --accent-tint: rgba(15, 118, 110, 0.08);
  --ink: #0F172A;
  --body: #334155;
  --body-2: #475569;
  --muted: #64748B;
  --bg: #F6F8FB;
  --surface: #FFFFFF;
  --surface-muted: #F8FAFC;
  --border: #E5EAF1;
  --border-strong: #D7DFEA;
  --success: #0F766E;
  --success-tint: #E6F4F2;
  --danger: #DC2626;
  --danger-tint: #FDECEC;
  --warning: #B45309;
  --warning-tint: #FEF3E2;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.14);
  --maxw: 1140px;
  --nav-h: 70px;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--body);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Keeps the footer at the bottom of short pages. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--primary-light); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }
.container-narrow { max-width: 880px; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--primary); color: #fff; padding: 12px 18px; border-radius: var(--r-md); z-index: 200; }
.skip-link:focus { left: 12px; top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 15px; line-height: 1;
  padding: 13px 22px; border-radius: var(--r-pill); border: 1.5px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(47, 82, 115, 0.28); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 10px 22px rgba(47, 82, 115, 0.34); }
.btn-ghost { background: var(--surface); color: var(--primary); border-color: var(--border-strong); }
.btn-ghost:hover:not(:disabled) { border-color: var(--primary-light); background: var(--primary-tint); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #F3C4C4; }
.btn-danger:hover:not(:disabled) { background: var(--danger-tint); }
.btn-white { background: #fff; color: var(--primary-dark); }
.btn-light { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.35); }
.btn-sm { padding: 9px 14px; font-size: 14px; }
.btn-lg { padding: 16px 28px; font-size: 16px; }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-link { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); font-weight: 600; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246, 248, 251, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; color: var(--ink); font-size: 19px; letter-spacing: -0.02em; }
.logo-mark { width: 38px; height: 38px; overflow: hidden; box-shadow: 0 4px 10px rgba(47, 82, 115, 0.3); flex: none; }
.logo-mark img { width: 100%; height: 100%; object-fit: cover; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { color: var(--body-2); font-weight: 500; font-size: 15px; padding: 9px 14px; border-radius: var(--r-sm); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); background: var(--primary-tint); }

/* Sections */
.page-hero { padding: 64px 0 40px; position: relative; overflow: hidden; }
.page-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 60% at 85% -10%, rgba(91, 127, 160, 0.18), transparent 60%),
    radial-gradient(50% 50% at 0% 110%, rgba(15, 118, 110, 0.10), transparent 60%);
}
.page-hero .container { position: relative; }
.page-hero h1 { font-size: clamp(32px, 4.6vw, 52px); font-weight: 800; letter-spacing: -0.03em; margin: 18px 0 0; max-width: 780px; }
.page-hero .lede { font-size: 19px; color: var(--body-2); margin-top: 18px; max-width: 640px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-tint); padding: 6px 14px; border-radius: var(--r-pill);
}
.section { padding: 32px 0 88px; }
/* Columns stretch to the taller one; the feature boxes share the extra height
   so both columns start and end together. */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.feature-list { display: grid; grid-auto-rows: 1fr; gap: 16px; }
.feature-item { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm); }
.feature-item h3 { font-size: 17px; margin-bottom: 4px; }
.feature-item p { font-size: 15px; color: var(--body-2); }
.feature-ico { width: 42px; height: 42px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--primary-tint); color: var(--primary); flex: none; }
.feature-ico svg { width: 22px; height: 22px; }
.admin-note { margin-top: 24px; }

/* Cards and forms */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 28px; box-shadow: var(--shadow); }
.card + .card { margin-top: 20px; }
.card h2 { font-size: 22px; }
.card .card-sub { color: var(--body-2); font-size: 15px; margin-top: 6px; }
.form { display: grid; gap: 16px; margin-top: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label, .field .label { font-weight: 600; font-size: 14px; color: var(--ink); }
.field .hint { font-size: 13px; color: var(--muted); }
.optional { font-weight: 500; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: var(--r-md);
  padding: 11px 14px; transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { min-height: 130px; resize: vertical; }
.textarea.code { font-family: var(--mono); font-size: 12.5px; min-height: 160px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 4px rgba(91, 127, 160, 0.18); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.alert { border-radius: var(--r-md); padding: 14px 16px; font-size: 14.5px; border: 1px solid transparent; }
.alert strong { color: inherit; }
.alert-success { background: var(--success-tint); color: #0B5A54; border-color: #BFE3DE; }
.alert-error { background: var(--danger-tint); color: #A61B1B; border-color: #F3C4C4; }
.alert-warning { background: var(--warning-tint); color: #8A4204; border-color: #F6D9AE; }
.alert-info { background: var(--primary-tint); color: var(--primary-dark); border-color: #D2DEEA; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: var(--r-pill); background: var(--surface-muted); color: var(--body-2); border: 1px solid var(--border); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-active { background: var(--success-tint); color: var(--success); border-color: #BFE3DE; }
.pill-pending { background: var(--warning-tint); color: var(--warning); border-color: #F6D9AE; }
.pill-error { background: var(--danger-tint); color: var(--danger); border-color: #F3C4C4; }
.pill-disabled, .pill-none { color: var(--muted); }

/* Admin layout */
.admin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.nav-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.admin-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; min-width: 0; }
.admin-meta .signed-in-as { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.status-bar .status-text { display: grid; gap: 4px; }
.status-bar .status-text h2 { font-size: 20px; }
.status-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; counter-reset: step; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-sm); padding: 24px 28px; }
.step-head { display: flex; align-items: flex-start; gap: 14px; }
.step-num {
  counter-increment: step; width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: var(--primary-tint); color: var(--primary); font-weight: 800; display: grid; place-items: center;
}
.step-num::before { content: counter(step); }
.step.done .step-num { background: var(--success); color: #fff; }
.step.done .step-num::before { content: "\2713"; }
.step-head h3 { font-size: 18px; }
.step-head p { color: var(--body-2); font-size: 14.5px; margin-top: 3px; }
.step-body { margin-top: 18px; padding-left: 48px; display: grid; gap: 16px; }

.choice-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.choice { position: relative; display: grid; gap: 4px; padding: 14px; border: 1.5px solid var(--border-strong); border-radius: var(--r-md); cursor: pointer; background: var(--surface); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice strong { color: var(--ink); font-size: 15px; }
.choice span { font-size: 13px; color: var(--muted); }
.choice:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 82, 115, 0.14); background: var(--primary-tint); }
.choice:has(input:focus-visible) { outline: 3px solid var(--primary-light); outline-offset: 2px; }

.kv { display: grid; gap: 10px; }
.kv-row { display: grid; grid-template-columns: 170px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--r-md); }
.kv-row dt { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0; }
.kv-row dd { margin: 0; font-family: var(--mono); font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.backup-link { margin-top: 16px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.table code, .code-inline { font-family: var(--mono); font-size: 12.5px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; overflow-wrap: anywhere; }
.instructions { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14.5px; }
.instructions li::marker { color: var(--primary); font-weight: 700; }
.domain-list { display: grid; gap: 12px; }
.domain { border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; display: grid; gap: 10px; }
.domain-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.domain-head strong { font-size: 15px; color: var(--ink); }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form .input { flex: 1 1 240px; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--r-pill); }
.tab { border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--body-2); padding: 7px 16px; border-radius: var(--r-pill); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.activity li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.activity time { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.center-card { max-width: 520px; margin: 48px auto; text-align: center; }
.center-card .btn { margin-top: 20px; }
.center-card .signin-hint { margin-top: 16px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--primary-tint); border-top-color: var(--primary); animation: spin 0.8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } .btn { transition: none; } }

/* Company console */
.company-card { margin-bottom: 16px; }
.create-inline { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.create-inline h3 { font-size: 17px; }
.console-tabs { display: flex; gap: 4px; padding: 5px; margin: 0 0 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill); box-shadow: var(--shadow-sm); overflow-x: auto; }
.console-tab { flex: 1 0 auto; border: 0; background: none; font: inherit; font-size: 15px; font-weight: 600; color: var(--body-2); padding: 10px 18px; border-radius: var(--r-pill); cursor: pointer; white-space: nowrap; }
.console-tab:hover { color: var(--ink); background: var(--primary-tint); }
.console-tab[aria-selected="true"] { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(47, 82, 115, 0.24); }
.tab-panel > .card + .card, .tab-panel > .alert + .card, .tab-panel > .card + .team-grid { margin-top: 20px; }
.tab-panel > .alert { margin-bottom: 16px; }
.section-head-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head-row .input { max-width: 320px; }
.section-head-row .field { min-width: 220px; }
/* position: relative contains absolutely positioned (visually hidden) labels
   so they can't widen the page beyond the scrollable table. */
.table-wrap { position: relative; overflow-x: auto; margin-top: 16px; }
.people-table td { vertical-align: middle; }
.people-table td:first-child { min-width: 220px; }
.people-table td:nth-child(4) { min-width: 140px; }
.people-table .row-muted td { opacity: .7; }
.person { display: grid; gap: 1px; min-width: 0; }
.person strong { color: var(--ink); font-size: 14.5px; overflow-wrap: anywhere; }
.person .small { overflow-wrap: anywhere; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12.5px; font-weight: 600; color: var(--primary-dark); background: var(--primary-tint); border-radius: var(--r-pill); padding: 3px 10px; white-space: nowrap; }
.team-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.team-card { display: grid; gap: 14px; align-content: start; }
.team-card + .team-card { margin-top: 0; }
.team-card h3 { font-size: 18px; }
.manager-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.manager-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--r-md); }
.select-sm { width: auto; padding: 7px 10px; font-size: 14px; }
.empty-state { display: grid; gap: 4px; text-align: center; padding: 28px 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface-muted); margin-top: 12px; }
.empty-state strong { color: var(--ink); }

/* 404 page */
.not-found-code {
  font-size: clamp(96px, 18vw, 168px); font-weight: 800; letter-spacing: -0.06em; line-height: 1; margin-top: 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 55%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.not-found-code + h1 { margin-top: 8px; }
.not-found-actions { margin-top: 28px; }
.not-found-heading { font-size: 15px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.link-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.link-grid .feature-item { align-items: flex-start; color: inherit; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.link-grid .feature-item:hover { border-color: var(--primary-light); box-shadow: var(--shadow); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .link-grid .feature-item { transition: none; } }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 32px 0; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 13.5px; }
.footer-bottom .links { display: flex; flex-wrap: wrap; gap: 22px; }
.footer-bottom a:hover { color: var(--primary); }

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .choice-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .container { padding-inline: 16px; }
  .nav-links a:not(.keep) { display: none; }
  .admin-meta .signed-in-as { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .step { padding: 20px 18px; }
  .step-body { padding-left: 0; }
  .kv-row { grid-template-columns: 1fr auto; }
  .team-grid { grid-template-columns: 1fr; }
  .link-grid { grid-template-columns: 1fr; }
  .section-head-row .input { max-width: none; }
  .row-actions { justify-content: flex-start; }
  .manager-row { flex-wrap: wrap; }
  .kv-row dt { grid-column: 1 / -1; }
  .card { padding: 22px 18px; }
  .page-hero { padding: 40px 0 28px; }
  .section { padding: 20px 0 64px; }
}
@media (max-width: 480px) {
  .choice-grid { grid-template-columns: 1fr; }
}
