/* ===========================================================
   tmailo.org — UI stylesheet
   Modern, responsive, light theme, Poppins. Mobile first.
   =========================================================== */

:root {
  --bg:        #f4f6fb;
  --bg-soft:   #ffffff;
  --surface:   #ffffff;
  --surface-2: #f7f9fc;
  --border:    #e4e8f0;
  --text:      #1a2233;
  --text-soft: #5b6678;
  --muted:     #8893a6;
  --brand:     #4f46e5;
  --brand-2:   #7c6cf5;
  --brand-ink: #ffffff;
  --ok:        #16a34a;
  --danger:    #e11d48;
  --shadow:    0 1px 2px rgba(16,24,40,.05), 0 8px 24px rgba(16,24,40,.06);
  --shadow-lg: 0 20px 50px rgba(16,24,40,.12);
  --radius:    16px;
  --radius-sm: 10px;
  --wrap:      1080px;
  --font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before {
  /* subtle brand glow behind the hero */
  content: "";
  position: fixed; inset: 0 0 auto 0; height: 420px; z-index: -1;
  background:
    radial-gradient(900px 340px at 20% -10%, color-mix(in srgb, var(--brand) 20%, transparent), transparent 70%),
    radial-gradient(700px 300px at 90% -20%, color-mix(in srgb, var(--brand-2) 18%, transparent), transparent 70%);
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 80%, transparent); border-bottom: 1px solid var(--border); }
.topbar__in { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand__mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  color: var(--brand-ink); background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: var(--shadow); }
.brand__name { font-size: 1.2rem; }
.topnav { display: flex; align-items: center; gap: 20px; }
.topnav a { color: var(--text-soft); font-weight: 600; font-size: .95rem; }
.topnav a:hover { color: var(--text); text-decoration: none; }


/* ---------- hero / address ---------- */
.hero { text-align: center; padding: 48px 0 8px; }
.hero__title { font-size: clamp(1.7rem, 4.5vw, 2.6rem); line-height: 1.1; letter-spacing: -.03em; margin: 0 0 12px; }
.hero__sub { max-width: 620px; margin: 0 auto 28px; color: var(--text-soft); font-size: 1.05rem; }

.addr {
  display: flex; gap: 12px; align-items: center; justify-content: center;
  max-width: 720px; margin: 0 auto; flex-wrap: wrap;
}
.addr__field {
  flex: 1 1 360px; min-width: 0; display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; box-shadow: var(--shadow);
}
.addr__icon { color: var(--brand); flex: none; }
.addr__value {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text);
  font-size: clamp(1rem, 3.5vw, 1.35rem); font-weight: 700; letter-spacing: -.01em;
  text-align: center; outline: none; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.addr__actions { display: flex; gap: 10px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 12px 16px; border-radius: 12px; font-weight: 650; font-size: .95rem;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); border: 0; box-shadow: var(--shadow); }
.btn--primary:hover { filter: brightness(1.05); }
.btn--sm { padding: 8px 12px; font-size: .85rem; border-radius: 10px; }
.btn--ghost { background: transparent; }
.btn--ghost:hover { color: var(--danger); border-color: var(--danger); }

/* tools row */
.tools {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: center;
  max-width: 720px; margin: 22px auto 0;
}
.tools__item { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.tools__item > span { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tools__item--grow { flex: 1 1 240px; }
.select, .input {
  appearance: none; background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 11px 14px; border-radius: 10px; font-size: .95rem; font-family: inherit; min-height: 44px;
}
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238893a6' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; cursor: pointer; }
.customname { display: flex; gap: 8px; }
.customname .input { flex: 1; min-width: 0; }
.ttl { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.1rem; color: var(--brand); padding: 8px 0; }

/* ---------- mail ---------- */
.mail { margin: 40px 0 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.mail__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.mail__title { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; }
.badge { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px;
  border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-size: .8rem; font-weight: 800; }
.mail__bar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status { display: inline-flex; align-items: center; gap: 7px; color: var(--text-soft); font-size: .85rem; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.mail__grid { display: grid; grid-template-columns: 1fr; min-height: 320px; }
@media (min-width: 860px) {
  .mail__grid { grid-template-columns: 360px 1fr; }
  .mail__grid.reading .list { display: block; }
}

.list { list-style: none; margin: 0; padding: 0; border-right: 1px solid var(--border); }
.list__item { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s ease; }
.list__item:hover { background: var(--surface-2); }
.list__item.active { background: color-mix(in srgb, var(--brand) 10%, var(--surface)); }
.list__item.unseen .list__subject { font-weight: 800; }
.list__item.unseen::before { content: ""; }
.avatar { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.list__main { min-width: 0; }
.list__from { font-size: .82rem; color: var(--text-soft); display: flex; align-items: center; gap: 6px; }
.list__subject { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list__time { color: var(--muted); font-size: .76rem; white-space: nowrap; }
.list__clip { color: var(--muted); }

.empty { display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center;
  color: var(--muted); padding: 60px 24px; grid-column: 1 / -1; }
.empty svg { opacity: .5; }
.empty p { margin: 0; }

/* reader */
.reader { display: flex; flex-direction: column; min-width: 0; }
.reader__back { align-self: flex-start; margin: 14px 0 0 14px; }
@media (min-width: 860px) { .reader__back { display: none; } }
.reader__head { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.reader__subject { margin: 0 0 8px; font-size: 1.25rem; line-height: 1.3; }
.reader__meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--text-soft); font-size: .9rem; }
.reader__date { color: var(--muted); }
.reader__attach { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: .82rem; color: var(--text); }
.chip:hover { text-decoration: none; border-color: var(--brand); }
.reader__body { width: 100%; border: 0; min-height: 420px; flex: 1; background: #fff; }

/* when reading on mobile, hide list */
@media (max-width: 859px) {
  .mail__grid.reading .list { display: none; }
  .mail__grid:not(.reading) .reader { display: none; }
}
@media (min-width: 860px) {
  .reader[hidden] { display: flex; }
  .reader:not(.has) .reader__head, .reader:not(.has) .reader__body { visibility: hidden; }
}

/* ---------- info sections ---------- */
.info { margin: 48px 0; }
.info > h2 { font-size: 1.5rem; letter-spacing: -.02em; margin: 0 0 20px; }
.steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.step__n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: color-mix(in srgb, var(--brand) 15%, transparent); color: var(--brand); font-weight: 800; margin-bottom: 10px; }
.step h3 { margin: 0 0 6px; font-size: 1.05rem; }
.step p { margin: 0; color: var(--text-soft); font-size: .94rem; }
details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 10px; }
details > summary { cursor: pointer; font-weight: 700; }
details > p { margin: 10px 0 0; color: var(--text-soft); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); margin-top: 20px; }
.footer__in { display: flex; justify-content: space-between; align-items: center; min-height: 60px; padding: 12px 0; color: var(--muted); font-size: .9rem; flex-wrap: wrap; gap: 8px; }
.footer a { color: var(--text-soft); }
.footer__links { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.footer__links a:hover { color: var(--brand); text-decoration: none; }
.topnav a.is-active { color: var(--text); font-weight: 700; }

/* ---------- ad slots ---------- */
.adslot { max-width: var(--wrap); margin: 16px auto; padding: 0 16px; text-align: center; }
.adslot:empty { display: none; }
.adslot img, .adslot ins { max-width: 100%; height: auto; }

/* ---------- auth pages ---------- */
.navbtn { padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px; font-weight: 700; color: var(--text) !important; }
.navbtn:hover { background: var(--surface-2); text-decoration: none; }
.authwrap { display: grid; place-items: center; padding: 40px 0; }
.authcard { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
.authcard__title { font-size: 1.5rem; margin: 0 0 6px; letter-spacing: -.02em; }
.authcard__sub { color: var(--text-soft); margin: 0 0 18px; font-size: .95rem; }
.authform { display: flex; flex-direction: column; gap: 14px; }
.authform label { display: flex; flex-direction: column; gap: 6px; font-weight: 650; font-size: .9rem; color: var(--text-soft); }
.authform .input { width: 100%; font-size: 1rem; }
.authform .btn { justify-content: center; margin-top: 4px; }
.authcard__foot { margin: 16px 0 0; text-align: center; color: var(--text-soft); font-size: .9rem; }
.authmsg { padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; font-size: .9rem; }
.authmsg--ok  { background: color-mix(in srgb, var(--ok) 13%, transparent); color: var(--ok); }
.authmsg--err { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- account dashboard ---------- */
.acct { padding: 32px 0; }
.acct__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.acct__title { font-size: 1.6rem; margin: 0 0 4px; letter-spacing: -.02em; }
.acctgrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.acctcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.acctcard h2 { margin: 0 0 12px; font-size: 1.1rem; }
.acctcard .authform { margin-top: 6px; }
.acctlist { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.acctlist li { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.pill--warn { background: color-mix(in srgb, #d97706 18%, transparent); color: #d97706; }

/* ---------- pricing / plans ---------- */
.plans { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); max-width: 920px; margin: 20px auto 0; }
.plan { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 24px; display: flex; flex-direction: column; }
.plan--featured { border-color: var(--brand); box-shadow: var(--shadow-lg); }
.plan__tag { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 4px 12px; border-radius: 999px; }
.plan__name { font-size: 1.2rem; margin: 0 0 8px; }
.plan__price { margin-bottom: 16px; }
.plan__amt { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; }
.plan__per { color: var(--muted); font-weight: 600; }
.plan__feats { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.plan__feats li { padding-left: 26px; position: relative; color: var(--text-soft); font-size: .93rem; }
.plan__feats li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.btn--block { display: flex; width: 100%; justify-content: center; }

/* ---------- checkout ---------- */
.paysteps { margin: 0 0 18px; padding-left: 20px; color: var(--text-soft); display: flex; flex-direction: column; gap: 8px; }
.addrbox { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: -4px 0 4px; }
.addrbox code { display: block; margin-top: 4px; word-break: break-all; }

/* ---------- invoice ---------- */
.invwrap { max-width: 640px; margin: 36px auto; }
.invoice { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; }
.invoice__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.invoice__brand { font-size: 1.3rem; font-weight: 800; }
.invoice__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0; }
.invoice__pay { width: 100%; border-collapse: collapse; }
.invoice__pay td { padding: 9px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.invoice__pay td.mono { word-break: break-all; text-align: right; padding-left: 16px; }
@media print { .topbar, .footer, .btn, .adslot { display: none !important; } .invoice { border: 0; box-shadow: none; } }

/* ---------- CMS pages ---------- */
.cms { max-width: 760px; margin: 32px auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
.cms__title { font-size: 1.9rem; letter-spacing: -.02em; margin: 0 0 18px; }
.cms__body { color: var(--text-soft); line-height: 1.7; }
.cms__body h2 { color: var(--text); font-size: 1.25rem; margin: 22px 0 10px; }
.cms__body h3 { color: var(--text); font-size: 1.05rem; margin: 18px 0 8px; }
.cms__body p { margin: 0 0 14px; }
.cms__body a { color: var(--brand); }
.cms__body ul, .cms__body ol { padding-left: 22px; margin: 0 0 14px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 650;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- add-domain page ---------- */
.dompage { padding-bottom: 40px; }
.dcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px 4px; margin-top: 20px; }
.dstep { display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 22px 20px; border-bottom: 1px solid var(--border); }
.dstep:last-child { border-bottom: 0; }
.dstep.is-hidden { display: none; }
.dstep__n { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, transparent); }
.dstep__body { min-width: 0; }
.dstep__body h2 { margin: 2px 0 10px; font-size: 1.2rem; }
.dmsg { margin: 12px 0 0; font-weight: 600; font-size: .92rem; }
.dmsg--ok { color: var(--ok); }
.dmsg--err { color: var(--danger); }
.small { font-size: .84rem; }
.muted { color: var(--muted); }
.muted code, .dstep code { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); padding: 2px 7px; border-radius: 6px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em; }
.tablewrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-top: 12px; }
.dtable { width: 100%; border-collapse: collapse; font-size: .9rem; }
.dtable th, .dtable td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.dtable th { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.dtable tr:last-child td { border-bottom: 0; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; word-break: break-all; }
.copyable { cursor: pointer; }
.copyable:hover { color: var(--brand); text-decoration: underline; }
.pill { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); }
.atdomain { display: inline-flex; align-items: center; padding: 0 6px; color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; white-space: nowrap; }
.teamlist { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-width: 600px; }
.teamlist__item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); flex-wrap: wrap; }
.teamlist__act { display: inline-flex; gap: 6px; }

@media (max-width: 560px) {
  .addr { flex-direction: column; }
  .addr__field { flex: 0 0 auto; width: 100%; }
  .dstep { grid-template-columns: 1fr; }
  .dstep__n { display: none; }
  .addr__actions { width: 100%; }
  .addr__actions .btn { flex: 1; justify-content: center; }
  .tools { flex-direction: column; align-items: stretch; }
  .tools__item { width: 100%; }
  .topnav a { display: none; }
}
