/* =========================================================================
   EmailsDoWork — design system
   Hand-written, single-file CSS. No framework. A distinctive email-SaaS brand:
   deep ink + a signal "outbox" violet, a crisp type scale, generous spacing,
   accessible contrast (WCAG AA on text), and a responsive app shell.
   ========================================================================= */

:root {
  /* Brand palette ------------------------------------------------------- */
  --ink-900: #0c1020;   /* near-black, headings */
  --ink-800: #161b2e;
  --ink-700: #232a42;
  --ink-500: #4a5170;   /* muted body */
  --ink-400: #6b7393;
  --ink-300: #aab1cc;
  --line:    #e6e8f0;   /* hairlines on light */
  --paper:   #ffffff;
  --paper-2: #f7f8fc;   /* app canvas */
  --paper-3: #eef1f9;

  --violet-600: #5b53f0;  /* primary signal */
  --violet-500: #6d66f5;
  --violet-50:  #eeedfe;
  --teal-500:   #11b3a3;  /* deliverability accent */
  --amber-500:  #e8a33d;
  --rose-500:   #e5484d;  /* danger / bounce */
  --green-500:  #2fa66a;  /* success / delivered */

  /* Type ---------------------------------------------------------------- */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Scale --------------------------------------------------------------- */
  --step--1: clamp(0.78rem, 0.75rem + 0.15vw, 0.86rem);
  --step-0:  clamp(0.95rem, 0.92rem + 0.2vw, 1.02rem);
  --step-1:  clamp(1.15rem, 1.05rem + 0.5vw, 1.35rem);
  --step-2:  clamp(1.5rem,  1.3rem + 1vw,   2.1rem);
  --step-3:  clamp(2rem,    1.6rem + 2vw,   3rem);
  --step-4:  clamp(2.6rem,  2rem + 3vw,     4.1rem);

  --radius:   12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow-1: 0 1px 2px rgba(12,16,32,.06), 0 1px 1px rgba(12,16,32,.04);
  --shadow-2: 0 8px 30px rgba(12,16,32,.10);
  --shadow-pop: 0 18px 50px rgba(20,16,80,.22);

  --maxw: 1120px;
}

/* Reset ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink-700);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { color: var(--ink-900); line-height: 1.15; margin: 0 0 .4em; font-weight: 680; letter-spacing: -0.02em; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p  { margin: 0 0 1rem; }
a  { color: var(--violet-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
code, kbd, samp { font-family: var(--font-mono); font-size: 0.9em; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1.25rem; }
.muted { color: var(--ink-500); }
.tiny  { font-size: var(--step--1); }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Buttons --------------------------------------------------------------- */
.btn {
  --bg: var(--violet-600); --fg: #fff; --bd: var(--violet-600);
  display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
  font: inherit; font-weight: 600; font-size: var(--step-0);
  padding: .68rem 1.15rem; border-radius: var(--radius-sm);
  background: var(--bg); color: var(--fg); border: 1px solid var(--bd);
  cursor: pointer; text-decoration: none; transition: transform .06s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: var(--shadow-1);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--violet-50); outline-offset: 2px; }
.btn--ghost { --bg: transparent; --fg: var(--ink-700); --bd: var(--line); box-shadow: none; }
.btn--ghost:hover { --bg: var(--paper-2); }
.btn--light { --bg: #fff; --fg: var(--violet-600); --bd: #fff; }
.btn--danger { --bg: transparent; --fg: var(--rose-500); --bd: rgba(229,72,77,.4); box-shadow: none; }
.btn--danger:hover { --bg: rgba(229,72,77,.07); }
.btn--block { width: 100%; }
.btn--sm { padding: .42rem .8rem; font-size: var(--step--1); }

/* Forms ----------------------------------------------------------------- */
.field { display: block; margin-bottom: 1.05rem; }
.field > label { display: block; font-weight: 600; font-size: var(--step--1); color: var(--ink-700); margin-bottom: .35rem; }
.input {
  width: 100%; font: inherit; font-size: var(--step-0);
  padding: .68rem .8rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--paper); color: var(--ink-900);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus { outline: none; border-color: var(--violet-500); box-shadow: 0 0 0 4px var(--violet-50); }
.input::placeholder { color: var(--ink-300); }

/* Alerts / flash -------------------------------------------------------- */
.alert { padding: .8rem 1rem; border-radius: var(--radius-sm); font-size: var(--step--1); margin-bottom: 1.1rem; border: 1px solid transparent; }
.alert--error  { background: #fdecec; border-color: #f6c9cb; color: #9c2025; }
.alert--notice { background: var(--violet-50); border-color: #d6d3fb; color: #3b34b8; }
.alert--ok     { background: #e7f6ee; border-color: #b9e3cb; color: #1c7a4b; }

/* Badges / pills -------------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: .35rem; font-size: var(--step--1); font-weight: 600; padding: .2rem .6rem; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-500); background: var(--paper-2); }
.pill--ok      { color: #1c7a4b; background: #e7f6ee; border-color: #b9e3cb; }
.pill--pending { color: #8a6320; background: #fbf1de; border-color: #efd9ad; }
.pill--failed  { color: #9c2025; background: #fdecec; border-color: #f6c9cb; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }

/* Cards ----------------------------------------------------------------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 1.4rem; }
.card h3 { margin-top: 0; }

/* Tables ---------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.table th { text-align: left; color: var(--ink-400); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; padding: .6rem .75rem; border-bottom: 1px solid var(--line); }
.table td { padding: .8rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.mono { font-family: var(--font-mono); font-size: .85em; color: var(--ink-700); }

/* =========================================================================
   Public marketing site
   ========================================================================= */
.site-nav { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.82); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line); }
.site-nav__inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.site-nav__links { display: flex; align-items: center; gap: 1.4rem; }
.site-nav__links a { color: var(--ink-700); font-weight: 550; font-size: var(--step--1); }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 760; color: var(--ink-900); font-size: 1.12rem; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(140deg, var(--violet-500), #8b5cf6 55%, var(--teal-500)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25), var(--shadow-1); position: relative; flex: none; }
.brand__mark::after { content: ""; position: absolute; inset: 8px; border-radius: 4px; border: 2px solid rgba(255,255,255,.9); border-bottom: none; clip-path: polygon(0 0, 100% 0, 50% 70%); }

.hero { position: relative; overflow: hidden; padding: clamp(3.5rem, 6vw, 6.5rem) 0 clamp(3rem, 5vw, 5rem); background:
  radial-gradient(120% 80% at 80% -10%, rgba(109,102,245,.16), transparent 60%),
  radial-gradient(90% 60% at 0% 0%, rgba(17,179,163,.10), transparent 55%),
  var(--paper); }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: var(--step-4); letter-spacing: -.035em; }
.hero p.lede { font-size: var(--step-1); color: var(--ink-500); max-width: 36ch; }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: var(--step--1); font-weight: 650; color: var(--violet-600); background: var(--violet-50); border: 1px solid #d8d5fb; padding: .3rem .7rem; border-radius: 999px; margin-bottom: 1.1rem; }
.cta-row { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }

/* Hero "inbox" visual */
.hero__card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); padding: 1.1rem; transform: rotate(1.2deg); }
.hero__card .row { display: flex; align-items: center; gap: .7rem; padding: .6rem .5rem; border-radius: 10px; }
.hero__card .row + .row { border-top: 1px solid var(--line); }
.hero__dot { width: 34px; height: 34px; border-radius: 9px; flex: none; background: var(--paper-3); display: grid; place-items: center; font-size: 1rem; }
.hero__meta { font-size: .8rem; color: var(--ink-400); }
.hero__bar { height: 6px; border-radius: 4px; background: var(--paper-3); overflow: hidden; margin-top: .5rem; }
.hero__bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--violet-500), var(--teal-500)); }

.logos { color: var(--ink-400); font-size: var(--step--1); display: flex; gap: 1.8rem; flex-wrap: wrap; align-items: center; margin-top: 2.4rem; }
.logos b { color: var(--ink-700); font-weight: 700; }

.section { padding: clamp(3rem, 5vw, 5rem) 0; }
.section--tint { background: var(--paper-2); border-block: 1px solid var(--line); }
.section__head { max-width: 52ch; margin-bottom: 2.4rem; }
.section__head .eyebrow { margin-bottom: .7rem; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.feature { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow-1); }
.feature__ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 1.2rem; background: var(--violet-50); color: var(--violet-600); margin-bottom: .9rem; }
.feature h3 { font-size: 1.08rem; margin-bottom: .3rem; }
.feature p { color: var(--ink-500); font-size: var(--step--1); margin: 0; }

.compat-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.compat-row .pill { background: #fff; }

/* Pricing --------------------------------------------------------------- */
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.2rem; align-items: stretch; }
.price { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.6rem 1.4rem; box-shadow: var(--shadow-1); position: relative; }
.price--featured { border-color: var(--violet-500); box-shadow: var(--shadow-2); }
.price--featured::before { content: "Most popular"; position: absolute; top: -.7rem; left: 1.4rem; background: var(--violet-600); color: #fff; font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: .25rem .6rem; border-radius: 999px; }
.price__name { font-weight: 700; font-size: 1.1rem; color: var(--ink-900); }
.price__amt { font-size: var(--step-3); font-weight: 720; color: var(--ink-900); letter-spacing: -.03em; margin: .3rem 0 0; }
.price__amt span { font-size: 1rem; font-weight: 550; color: var(--ink-400); }
.price__quota { color: var(--ink-500); font-size: var(--step--1); margin: .5rem 0 1.1rem; }
.price ul { list-style: none; padding: 0; margin: 0 0 1.4rem; display: grid; gap: .5rem; }
.price li { display: flex; gap: .5rem; align-items: flex-start; font-size: var(--step--1); color: var(--ink-700); }
.price li::before { content: "✓"; color: var(--teal-500); font-weight: 800; }
.price .btn { margin-top: auto; }

/* Footer ---------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); background: var(--paper-2); padding: 2.4rem 0; margin-top: 2rem; }
.site-footer__inner { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; align-items: center; }
.site-footer a { color: var(--ink-500); font-size: var(--step--1); margin-left: 1.2rem; }

/* =========================================================================
   Auth pages (centered card on a tinted canvas)
   ========================================================================= */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background:
  radial-gradient(80% 60% at 50% -10%, rgba(109,102,245,.12), transparent 60%), var(--paper-2); }
.auth-card { width: 100%; max-width: 410px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); padding: 2rem 1.9rem; }
.auth-card .brand { margin-bottom: 1.4rem; }
.auth-card h1 { font-size: var(--step-2); }
.auth-sub { color: var(--ink-500); font-size: var(--step--1); margin-top: -.2rem; margin-bottom: 1.4rem; }
.auth-foot { margin-top: 1.4rem; font-size: var(--step--1); color: var(--ink-500); text-align: center; }
.auth-aside { display: flex; justify-content: space-between; font-size: var(--step--1); margin-top: -.4rem; margin-bottom: 1.1rem; }

/* =========================================================================
   App shell (sidebar + content)
   ========================================================================= */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; background: var(--paper-2); }
.side { background: var(--ink-900); color: var(--ink-300); display: flex; flex-direction: column; padding: 1.1rem .9rem; position: sticky; top: 0; height: 100vh; }
.side .brand { color: #fff; padding: .3rem .4rem 1.1rem; }
.side .brand__mark { box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-500); padding: 1rem .65rem .35rem; }
.nav a { display: flex; align-items: center; gap: .65rem; padding: .55rem .65rem; border-radius: var(--radius-sm); color: var(--ink-300); font-size: var(--step--1); font-weight: 550; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.is-active { background: var(--violet-600); color: #fff; box-shadow: var(--shadow-1); }
.nav a .ic { width: 18px; text-align: center; opacity: .9; }
.side__foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding-top: .9rem; font-size: var(--step--1); }
.side__user { color: var(--ink-300); padding: 0 .4rem .6rem; overflow: hidden; text-overflow: ellipsis; }
.side__foot form { margin: 0; }
.side__foot .btn { width: 100%; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.6rem; border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 10; }
.topbar h1 { font-size: var(--step-1); margin: 0; }
.content { padding: 1.6rem; }
.content > * + * { margin-top: 1.4rem; }

/* Stat cards */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow-1); }
.stat__k { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-400); font-weight: 600; }
.stat__v { font-size: var(--step-2); font-weight: 720; color: var(--ink-900); letter-spacing: -.02em; margin-top: .15rem; }
.stat__sub { font-size: var(--step--1); color: var(--ink-500); margin-top: .1rem; }
.stat--accent { background: linear-gradient(160deg, var(--ink-900), var(--ink-700)); border-color: var(--ink-700); }
.stat--accent .stat__k { color: var(--ink-300); }
.stat--accent .stat__v, .stat--accent .stat__sub { color: #fff; }

/* Quota meter */
.meter { height: 10px; border-radius: 6px; background: var(--paper-3); overflow: hidden; margin-top: .6rem; }
.meter > i { display: block; height: 100%; background: linear-gradient(90deg, var(--violet-500), var(--teal-500)); border-radius: 6px; transition: width .4s ease; }
.meter--warn > i { background: linear-gradient(90deg, var(--amber-500), var(--rose-500)); }

/* DNS record block */
.dns { display: grid; gap: .7rem; }
.dns__rec { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .85rem 1rem; background: var(--paper-2); }
.dns__rec header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.dns__rec h4 { margin: 0; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-500); }
.dns__kv { display: grid; grid-template-columns: 70px 1fr; gap: .3rem .8rem; font-size: var(--step--1); }
.dns__kv dt { color: var(--ink-400); font-weight: 600; }
.dns__kv dd { margin: 0; }
.copy { font-family: var(--font-mono); font-size: .82rem; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: .3rem .5rem; word-break: break-all; color: var(--ink-800); display: block; }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .2rem; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--ink-400); border: 1px dashed var(--line); border-radius: var(--radius); background: var(--paper); }

.raw-key { background: var(--ink-900); color: #d9f7ec; font-family: var(--font-mono); font-size: .9rem; padding: .8rem 1rem; border-radius: var(--radius-sm); word-break: break-all; }

/* Responsive ------------------------------------------------------------ */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__card { display: none; }
  .features { grid-template-columns: 1fr; }
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .4rem; }
  .side .brand { padding: .3rem .4rem; width: 100%; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav__label { display: none; }
  .side__foot { margin: 0 0 0 auto; border: 0; padding: 0; }
}
@media (max-width: 620px) {
  .site-nav__links a:not(.btn) { display: none; }
  .dns__kv { grid-template-columns: 1fr; }
}
