/* eForward design system: tokens, base and shared components for the landing page and the app.
   Each surface links this file first and keeps only its own layout in a second stylesheet. */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-400-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-400-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-500-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-500-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: light;

  --ef-bg: #fafaf9;
  --ef-surface: #ffffff;
  --ef-surface-2: #f3f3f1;
  --ef-ink: #0c0c0d;
  --ef-ink-2: #56575c;
  --ef-ink-3: #737479;
  --ef-line: #e4e4e2;
  --ef-line-strong: #8e8f94;

  /* Signal yellow: the one main action per screen, the marker, the active tab, selection. Never text. */
  --ef-signal: #ffd60a;
  --ef-signal-ink: #0c0c0d;
  --ef-signal-soft: #fff6c2;
  --ef-primary-hover-bg: #0c0c0d;
  --ef-primary-hover-fg: #ffd60a;

  --ef-ok: #0f7a55;
  --ef-ok-soft: #e3f4ec;
  --ef-warn: #a35200;
  --ef-warn-soft: #fdf0e1;
  --ef-bad: #c4231b;
  --ef-bad-soft: #fde8e6;

  --ef-focus: #0c0c0d;

  /* The marker sits behind the lower part of the letters; on dark it drops below the line,
     because light text on yellow is unreadable. */
  --ef-mark: linear-gradient(transparent 55%, var(--ef-signal) 55%, var(--ef-signal) 92%, transparent 92%);
  --ef-mark-pad: 0px;

  --ef-sans: "IBM Plex Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --ef-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --ef-text-display: clamp(2.5rem, 1.4rem + 4.6vw, 4.5rem);
  --ef-text-h1: clamp(1.75rem, 1.3rem + 1.9vw, 2.5rem);
  --ef-text-h2: 1.5rem;
  --ef-text-h3: 1.125rem;
  --ef-text-body: 1rem;
  --ef-text-small: 0.875rem;
  --ef-text-label: 0.6875rem;

  --ef-space-1: 4px;
  --ef-space-2: 8px;
  --ef-space-3: 12px;
  --ef-space-4: 16px;
  --ef-space-5: 24px;
  --ef-space-6: 32px;
  --ef-space-7: 48px;
  --ef-space-8: 64px;
  --ef-space-9: 96px;

  --ef-radius: 4px;
  --ef-radius-sm: 2px;
  --ef-border: 1px;
  --ef-border-control: 1.5px;

  --ef-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ef-fast: 120ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --ef-bg: #0c0c0d;
    --ef-surface: #151517;
    --ef-surface-2: #1e1e21;
    --ef-ink: #f2f2f0;
    --ef-ink-2: #a8a9ad;
    --ef-ink-3: #85868b;
    --ef-line: #2a2a2e;
    --ef-line-strong: #5c5d62;

    --ef-signal-soft: #3a3210;
    --ef-primary-hover-bg: #ffe352;
    --ef-primary-hover-fg: #0c0c0d;

    --ef-ok: #4cc994;
    --ef-ok-soft: #10291f;
    --ef-warn: #f0a24a;
    --ef-warn-soft: #2e1f0d;
    --ef-bad: #ff7a6e;
    --ef-bad-soft: #331513;

    --ef-focus: #ffd60a;

    --ef-mark: linear-gradient(transparent 86%, var(--ef-signal) 86%);
    --ef-mark-pad: 0.08em;
  }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ef-bg);
  color: var(--ef-ink);
  font-family: var(--ef-sans);
  font-size: var(--ef-text-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--ef-signal); color: var(--ef-signal-ink); }
:focus-visible { outline: 2px solid var(--ef-focus); outline-offset: 2px; }
[hidden] { display: none !important; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--ef-line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color var(--ef-fast), text-decoration-thickness var(--ef-fast);
}
a:hover { text-decoration-color: var(--ef-signal); text-decoration-thickness: 3px; }

code, kbd, samp, .ef-mono { font-family: var(--ef-mono); font-size: 0.92em; }

/* ---------- Components ---------- */

.ef-wordmark {
  display: inline-block;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--ef-ink);
  text-decoration: none;
  background: var(--ef-mark);
  padding: 0 0.1em var(--ef-mark-pad);
}
.ef-wordmark:hover { text-decoration: none; }

.ef-mark {
  background: var(--ef-mark);
  padding: 0 0.06em var(--ef-mark-pad);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.ef-label {
  font-family: var(--ef-mono);
  font-size: var(--ef-text-label);
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ef-ink-2);
}

.ef-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ef-space-2);
  padding: 11px 18px;
  border: var(--ef-border-control) solid var(--ef-ink);
  border-radius: var(--ef-radius);
  background: transparent;
  color: var(--ef-ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--ef-fast), color var(--ef-fast), border-color var(--ef-fast);
}
.ef-btn:hover { background: var(--ef-surface-2); text-decoration: none; }
.ef-btn--primary { background: var(--ef-signal); color: var(--ef-signal-ink); border-color: var(--ef-signal-ink); }
.ef-btn--primary:hover { background: var(--ef-primary-hover-bg); color: var(--ef-primary-hover-fg); border-color: var(--ef-primary-hover-bg); }
.ef-btn--sm { padding: 6px 12px; font-size: var(--ef-text-small); }
.ef-btn--danger { color: var(--ef-bad); border-color: var(--ef-bad); }
.ef-btn--danger:hover { background: var(--ef-bad-soft); }
.ef-btn--quiet { border-color: transparent; color: var(--ef-ink-2); padding-inline: 8px; }
.ef-btn--quiet:hover { color: var(--ef-ink); background: var(--ef-surface-2); }
.ef-btn--block { display: flex; width: 100%; }
.ef-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.ef-chip {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--ef-line);
  border-radius: var(--ef-radius-sm);
  font-family: var(--ef-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
  white-space: nowrap;
  color: var(--ef-ink-2);
}

.ef-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: var(--ef-radius-sm);
  font-family: var(--ef-mono);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  color: var(--ef-ink-2);
  background: var(--ef-surface-2);
}
.ef-status::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ef-status--ok { color: var(--ef-ok); background: var(--ef-ok-soft); }
.ef-status--warn { color: var(--ef-warn); background: var(--ef-warn-soft); }
.ef-status--bad { color: var(--ef-bad); background: var(--ef-bad-soft); }

/* Notices: the result of an action or a problem on the page. */
.ef-notice {
  padding: 12px 16px;
  border-left: 3px solid var(--ef-line-strong);
  border-radius: var(--ef-radius);
  background: var(--ef-surface-2);
  color: var(--ef-ink);
  font-size: 0.9375rem;
}
.ef-notice > :first-child { margin-top: 0; }
.ef-notice > :last-child { margin-bottom: 0; }
.ef-notice ul { margin: 6px 0 0; padding-left: 20px; }
.ef-notice--ok { border-left-color: var(--ef-ok); background: var(--ef-ok-soft); }
.ef-notice--warn { border-left-color: var(--ef-warn); background: var(--ef-warn-soft); }
.ef-notice--bad { border-left-color: var(--ef-bad); background: var(--ef-bad-soft); }

/* Panels group one task on a page. */
.ef-panel { background: var(--ef-surface); border: 1px solid var(--ef-line); border-radius: var(--ef-radius); }
.ef-panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 16px 20px; border-bottom: 1px solid var(--ef-line); }
.ef-panel__title { margin: 0; font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; }
.ef-panel__body { padding: 20px; }
.ef-panel__body > :first-child { margin-top: 0; }
.ef-panel__body > :last-child { margin-bottom: 0; }
.ef-panel__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--ef-line); }
details.ef-panel > summary { display: flex; align-items: center; gap: 10px; padding: 16px 20px; cursor: pointer; list-style: none; font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em; }
details.ef-panel > summary::-webkit-details-marker { display: none; }
details.ef-panel > summary::after { content: "+"; margin-left: auto; font-family: var(--ef-mono); font-weight: 400; color: var(--ef-ink-2); }
details.ef-panel[open] > summary { border-bottom: 1px solid var(--ef-line); }
details.ef-panel[open] > summary::after { content: "−"; }

/* Tables of domains, records, aliases and mailboxes. */
.ef-table-wrap { overflow-x: auto; }
.ef-table { width: 100%; border-collapse: collapse; font-size: var(--ef-text-small); }
.ef-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--ef-line);
  font-family: var(--ef-mono);
  font-size: var(--ef-text-label);
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
  color: var(--ef-ink-2);
}
.ef-table td { padding: 12px; border-bottom: 1px solid var(--ef-line); vertical-align: middle; }
.ef-table tr:last-child td { border-bottom: 0; }
.ef-table th:first-child, .ef-table td:first-child { padding-left: 20px; }
.ef-table th:last-child, .ef-table td:last-child { padding-right: 20px; }
.ef-table .ef-num { text-align: right; font-variant-numeric: tabular-nums; }
.ef-table .ef-end { text-align: right; white-space: nowrap; }
.ef-table .ef-empty { padding-block: 28px; text-align: center; color: var(--ef-ink-2); }
.ef-table .ef-mono { overflow-wrap: anywhere; }
/* On narrow screens a stacked table shows each row as a card; cells label themselves with data-label. */
@media (max-width: 640px) {
  .ef-table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ef-table--stack, .ef-table--stack tbody, .ef-table--stack tr, .ef-table--stack td { display: block; width: 100%; }
  .ef-table--stack tr { padding: 14px 20px; border-bottom: 1px solid var(--ef-line); }
  .ef-table--stack tr:last-child { border-bottom: 0; }
  .ef-table--stack td, .ef-table--stack td:first-child, .ef-table--stack td:last-child { padding: 3px 0; border: 0; text-align: left; }
  .ef-table--stack td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-family: var(--ef-mono);
    font-size: var(--ef-text-label);
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ef-ink-2);
  }
  .ef-table--stack td.ef-end { padding-top: 10px; }
  .ef-table--stack .ef-num { text-align: left; }
  .ef-table--stack .ef-empty { text-align: center; }
}

/* Form controls. */
.ef-field { display: grid; gap: 6px; }
.ef-field > label, .ef-legend { font-size: var(--ef-text-small); font-weight: 600; }
.ef-input {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: var(--ef-border-control) solid var(--ef-line-strong);
  border-radius: var(--ef-radius);
  background: var(--ef-surface);
  color: var(--ef-ink);
  font: inherit;
  font-size: 0.9375rem;
  transition: border-color var(--ef-fast);
}
.ef-input:hover { border-color: var(--ef-ink-2); }
.ef-input:focus { border-color: var(--ef-ink); }
.ef-input::placeholder { color: var(--ef-ink-3); }
.ef-input.ef-mono { font-family: var(--ef-mono); font-size: 0.9375rem; }
select.ef-input {
  appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ef-ink-2) 50%), linear-gradient(135deg, var(--ef-ink-2) 50%, transparent 50%);
  background-position: right 18px top 50%, right 13px top 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.ef-check { display: flex; align-items: center; gap: 10px; font-size: 0.9375rem; cursor: pointer; }
.ef-check input, input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--ef-ink); flex: none; }
.ef-hint { margin: 0; font-size: var(--ef-text-small); color: var(--ef-ink-2); }
.ef-error { margin: 0; font-size: var(--ef-text-small); font-weight: 500; color: var(--ef-bad); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
