/* PolvoMail: identidade "fundo do mar". Coral é a marca e a ação principal; azul-mar é link e informação. */
:root {
  color-scheme: light;
  --bg: #fbf8f5; --surface: #ffffff; --surface-2: #f4efea; --line: #e8e1da;
  --text: #14181f; --text-2: #4a5260; --muted: #6b7380;
  --accent: #d13a42; --accent-ink: #fff; --accent-soft: #fdeceb;
  --link: #0b6e79; --brand: #e5484d;
  --abyss: #0e1a27; --abyss-2: #172636; --abyss-text: #c8d3e0; --abyss-muted: #8fa3b8;
  --series-1: #008e9e; --series-2: #e5484d; --series-3: #6e56cf;
  --good: #1f7a3a; --good-bg: #e3f3e7; --warn: #8a5a00; --warn-bg: #fdf1d6;
  --bad: #b42323; --bad-bg: #fbe4e4; --info-bg: #e3f2f3;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 6px 20px rgba(16,24,40,.06);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b131c; --surface: #111c27; --surface-2: #172433; --line: #22344a;
    --text: #eef2f6; --text-2: #b4c0ce; --muted: #8494a7;
    --accent: #d13a42; --accent-soft: #3a1c22; --link: #4fc3cf;
    --abyss: #08101a; --abyss-2: #132131;
    --series-1: #1c9aa6; --series-2: #e5484d; --series-3: #8b76e6;
    --good: #6fd08c; --good-bg: #17301f; --warn: #f0c060; --warn-bg: #332a12;
    --bad: #ff8a8f; --bad-bg: #3a1a1e; --info-bg: #10303a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b131c; --surface: #111c27; --surface-2: #172433; --line: #22344a;
  --text: #eef2f6; --text-2: #b4c0ce; --muted: #8494a7;
  --accent: #d13a42; --accent-soft: #3a1c22; --link: #4fc3cf;
  --abyss: #08101a; --abyss-2: #132131;
  --series-1: #1c9aa6; --series-2: #e5484d; --series-3: #8b76e6;
  --good: #6fd08c; --good-bg: #17301f; --warn: #f0c060; --warn-bg: #332a12;
  --bad: #ff8a8f; --bad-bg: #3a1a1e; --info-bg: #10303a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -0.02em; font-weight: 750; } h2 { font-size: 16px; margin: 0 0 12px; } h3 { font-size: 14px; margin: 16px 0 8px; }
p.sub { color: var(--text-2); margin: 0 0 20px; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: auto; white-space: pre; margin: 0 0 12px; }

.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
nav.side { background: var(--abyss); color: var(--abyss-text); padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.brand { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; padding: 4px 10px 18px; display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
.brand::before { content: ""; display: inline-block; vertical-align: middle; width: 30px; height: 30px; flex: none; background: url(logo.svg) center / contain no-repeat; }
.brand b { font-weight: inherit; } .brand span { color: var(--brand); }
nav.side .brand { color: #fff; }
nav.side a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--abyss-text); text-decoration: none; transition: background .15s, color .15s; }
nav.side a svg { flex: none; opacity: .75; }
nav.side a:hover { background: var(--abyss-2); color: #fff; }
nav.side a.on { background: var(--abyss-2); color: #fff; font-weight: 650; box-shadow: inset 3px 0 0 var(--brand); }
nav.side a.on svg { opacity: 1; color: var(--brand); }
nav.side .sep { height: 1px; background: var(--abyss-2); margin: 10px; }
nav.side .who { padding: 10px; color: var(--abyss-muted); font-size: 12px; word-break: break-all; }
main { padding: 32px 36px; max-width: 1200px; width: 100%; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 12px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -18px; top: -18px; width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); opacity: .55; }
.kpi .l { color: var(--text-2); font-size: 12.5px; }
.kpi .v { font-size: 28px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .s { color: var(--muted); font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--text-2); font-weight: 600; font-size: 12.5px; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--surface-2); }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
.table-wrap { overflow-x: auto; }
.empty { color: var(--muted); padding: 24px; text-align: center; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--link); }

button, .btn { font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 8px 15px; border-radius: 10px; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; }
button:active { transform: translateY(1px); }
button:hover { background: var(--surface-2); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover { background: #b8303a; border-color: #b8303a; }
button:disabled { opacity: .55; cursor: default; }
button.danger { color: var(--bad); }
button.small { padding: 3px 10px; font-size: 12.5px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 18%, transparent); }
textarea { font-family: var(--mono); font-size: 12.5px; min-height: 120px; resize: vertical; }
label { display: block; margin-bottom: 12px; color: var(--text-2); font-size: 12.5px; }
label > input, label > select, label > textarea { margin-top: 4px; }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 14px; }
.check input { width: auto; }
.check[hidden] { display: none; }
.form2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.banner { border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.info { background: var(--info-bg); display: block; }
.banner input { width: 140px; }

.secret { font-family: var(--mono); background: var(--surface-2); border: 1px dashed var(--link); padding: 10px; border-radius: 8px; word-break: break-all; margin: 8px 0; }
.copy { cursor: pointer; }
.dns td { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.dns td:first-child { word-break: normal; min-width: 150px; }
.dns td:nth-child(3) { min-width: 160px; }

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth { width: 100%; max-width: 400px; }
.auth .tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.auth .tabs button { flex: 1; }
.auth .tabs button.on { background: var(--info-bg); border-color: var(--link); }
.err { color: var(--bad); min-height: 20px; margin: 4px 0 10px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
iframe.preview { width: 100%; height: 480px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

.chart { position: relative; }
.chart svg { width: 100%; height: 220px; display: block; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; box-shadow: 0 4px 16px rgba(0,0,0,.12); white-space: nowrap; }
.legend { display: flex; gap: 16px; color: var(--text-2); font-size: 12.5px; margin-bottom: 8px; }
.legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0 8px 18px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--surface); }
.timeline .when { color: var(--muted); font-size: 12px; }

.modal { position: fixed; inset: 0; background: rgba(8,16,26,.55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal[hidden] { display: none; }
.modal-box { background: var(--surface); border-radius: 18px; padding: 24px; box-shadow: 0 24px 60px rgba(0,0,0,.3); width: 100%; max-width: 760px; max-height: 90vh; overflow: auto; position: relative; }
.modal-x { position: absolute; right: 10px; top: 8px; border: 0; font-size: 22px; background: none; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--abyss); color: #fff; padding: 11px 20px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-weight: 600; z-index: 20; max-width: 90vw; }
.toast[hidden] { display: none; }

@media (max-width: 800px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  nav.side { position: sticky; z-index: 5; height: auto; display: flex; gap: 2px; padding: 8px 10px; overflow-x: auto; scrollbar-width: none; }
  nav.side .brand { padding: 4px 8px 4px 2px; font-size: 0; gap: 0; }
  nav.side a { white-space: nowrap; padding: 7px 10px; }
  nav.side a.on { box-shadow: inset 0 -2px 0 var(--brand); }
  nav.side .sep, nav.side .who { display: none; }
  main { padding: 18px 16px; }
  .split, .form2 { grid-template-columns: 1fr; }
}

.auth-split { display: grid; grid-template-columns: 1fr 420px; gap: 48px; align-items: center; width: 100%; max-width: 940px; }
.auth-pitch h2 { font-size: 28px; line-height: 1.2; margin: 18px 0 16px; }
.auth-pitch ul { padding-left: 18px; color: var(--text-2); line-height: 1.9; margin: 0; }
.auth-pitch .brand, .auth-brand { text-decoration: none; color: var(--text); padding: 0; }
.auth-brand { display: none; margin-bottom: 14px; }
.auth h1 { margin-bottom: 4px; }
.auth .check { margin: 4px 0 4px; font-size: 13px; color: var(--text-2); }
.auth-foot { text-align: center; color: var(--text-2); margin: 16px 0 0; }
#mhelp ol { margin: 0; padding-left: 18px; } #mhelp p { margin: 6px 0 0; }
@media (max-width: 800px) {
  .auth-split { grid-template-columns: 1fr; max-width: 440px; }
  .auth-pitch { display: none; }
  .auth-brand { display: inline-block; }
}
.auth { justify-self: center; }

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

/* Configurar a conta: passo a passo + assistente */
.setup { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.st-prog { margin-bottom: 14px; } .st-prog b { font-size: 15px; }
.st-bar { height: 8px; border-radius: 8px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.st-bar i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--series-1), var(--brand)); transition: width .4s; }
.st-list { list-style: none; margin: 0; padding: 0; }
.st-list li { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: start; padding: 11px 0; border-top: 1px solid var(--line); }
.st-list li p { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
.st-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; margin-top: 1px; }
.st-list li.done .st-dot { background: var(--good); border-color: var(--good); color: #fff; }
.st-list li.done b { color: var(--text-2); }
.st-go { font-size: 13px; font-weight: 650; white-space: nowrap; padding-top: 2px; }
.chat { display: flex; flex-direction: column; height: calc(100vh - 170px); min-height: 460px; padding: 0; overflow: hidden; }
.chat-head { display: flex; gap: 10px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chat-head div { flex: 1; } .chat-head span { display: block; color: var(--muted); font-size: 12px; }
.chat-log { flex: 1; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; line-height: 1.5; word-wrap: break-word; }
.msg p { margin: 0 0 6px; } .msg p:last-child { margin: 0; } .msg ul { margin: 4px 0 6px; padding-left: 20px; }
.msg code { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; font-size: 12.5px; word-break: break-all; }
.msg.assistant { background: var(--surface-2); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg.user { background: var(--abyss); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.msg.error { background: var(--bad-bg); color: var(--bad); align-self: center; font-size: 13px; }
.typing { display: flex; gap: 4px; padding: 14px; } .typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .25; } }
.chat-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 18px; }
.chat-actions:not(:empty) { padding-bottom: 10px; }
.chat-actions .btn { text-decoration: none; border-color: var(--brand); color: var(--accent); }
.chat-form { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-form textarea { font-family: var(--font); font-size: 14px; min-height: 42px; max-height: 160px; resize: none; }
.chat-note { margin: 0; padding: 0 16px 12px; color: var(--muted); font-size: 12px; }
@media (max-width: 1000px) { .setup { grid-template-columns: 1fr; } .chat { height: 70vh; } }

/* Plano e pagamento */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.plan-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.plan-card.cur { border: 2px solid var(--link); }
.plan-card h3 { margin: 0; font-size: 16px; }
.pc-price { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 2px; }
.pc-price small { font-size: 13px; color: var(--muted); font-weight: 600; }
.pc-was { color: var(--muted); font-size: 12.5px; } .pc-was s { text-decoration-color: var(--brand); }
.plan-card ul { flex: 1; margin: 12px 0 14px; padding-left: 18px; color: var(--text-2); font-size: 13px; }
.plan-card li { margin-bottom: 3px; }
.plan-card .btn, .plan-card button { text-align: center; text-decoration: none; }

/* Ajuda de cada tela */
.help-btn { font: 600 12.5px var(--font); vertical-align: middle; margin-left: 10px; padding: 4px 11px 4px 9px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--link); letter-spacing: 0; }
.help-btn:hover { background: var(--info-bg); }
.help-veil { position: fixed; inset: 0; background: rgba(8,16,26,.35); z-index: 30; }
.help-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--surface); z-index: 31; box-shadow: -12px 0 40px rgba(0,0,0,.2);
  padding: 18px 24px 28px; overflow: auto; animation: helpIn .2s ease-out; }
@keyframes helpIn { from { transform: translateX(24px); opacity: 0; } }
.help-top { display: flex; align-items: center; justify-content: space-between; }
.help-kicker { color: var(--accent); font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.help-top .ib { font-size: 22px; width: 36px; height: 36px; }
.help-drawer h2 { font-size: 22px; margin: 6px 0 14px; letter-spacing: -0.02em; }
.help-drawer h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 6px; }
.help-drawer p { margin: 0; color: var(--text-2); line-height: 1.6; }
.help-drawer ol, .help-drawer ul { margin: 0; padding-left: 20px; color: var(--text-2); line-height: 1.6; }
.help-drawer li { margin-bottom: 6px; }
.help-foot { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 13.5px; }
@media (max-width: 560px) { .help-btn span { display: none; } }

/* Caixas de e-mail hospedadas */
.hb-dom { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-top: 10px; }
.hb-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 14px; align-items: end; }
.hb-addr { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.hb-addr input, .hb-addr select { margin: 0; }
.hb-how { margin: 0; padding-left: 18px; color: var(--text-2); line-height: 1.8; }
#rl textarea, #alf textarea { font-family: inherit; }
