:root {
  --shadow: #272727;
  --shadow-2: #1e1e1e;
  --shadow-3: #333331;
  --clay: #D4AA7D;
  --clay-dim: #b8925f;
  --ink: #e8e2d9;
  --ink-dim: #a09a90;
  --danger: #d97b6c;
  --ok: #a5c47a;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  background: var(--shadow);
  color: var(--ink);
  font-family: 'Poppins', system-ui, sans-serif;
  display: flex; flex-direction: column; min-height: 100vh;
}
a { color: var(--clay); text-decoration: none; }
a:hover { color: var(--ink); }

.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem; max-width: 1100px; margin: 0 auto; width: 100%;
}
.brand { font-size: 1.5rem; letter-spacing: -0.5px; }
.brand-txt { font-weight: 800; color: var(--clay); }
.brand-me { font-weight: 200; color: var(--ink); }
.nav-links { display: flex; align-items: center; gap: 1.2rem; font-size: 0.95rem; }
.inline { display: inline; }

.main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 1rem 1.5rem 3rem; }
.footer { text-align: center; padding: 1.2rem; color: var(--ink-dim); font-size: 0.8rem; font-weight: 200; }

/* buttons + forms */
.btn {
  display: inline-block; border: none; cursor: pointer; font-family: inherit;
  font-weight: 600; border-radius: var(--radius); padding: 0.7rem 1.4rem;
  font-size: 1rem; transition: filter .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--clay); color: var(--shadow); }
.btn-primary:hover { filter: brightness(1.08); color: var(--shadow); }
.btn-primary:disabled { background: var(--shadow-3); color: var(--ink-dim); cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink-dim); border: 1px solid var(--shadow-3); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-dim); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.8rem; color: var(--ink-dim); margin-bottom: 0.3rem; text-transform: uppercase; letter-spacing: 1px; }
input[type=text], input[type=email], input[type=password], input[type=tel], textarea, select {
  width: 100%; background: var(--shadow-2); border: 1px solid var(--shadow-3);
  border-radius: var(--radius); color: var(--ink); font-family: inherit;
  font-size: 1rem; padding: 0.7rem 0.9rem; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--clay); }
textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
.hp { position: absolute; left: -9999px; opacity: 0; }

.error { background: rgba(217,123,108,.12); color: var(--danger); padding: 0.7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.success { background: rgba(165,196,122,.12); color: var(--ok); padding: 0.7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.help { font-size: 0.85rem; margin-top: 0.5rem; min-height: 1.2rem; }
.help.ok { color: var(--ok); } .help.bad { color: var(--danger); }

/* cards */
.card { background: var(--shadow-2); border: 1px solid var(--shadow-3); border-radius: var(--radius); padding: 1.5rem; }
.grid { display: grid; gap: 1.2rem; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 780px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* landing */
.hero { text-align: center; padding: 4rem 1rem 3rem; }
.hero h1 { font-size: clamp(2.4rem, 7vw, 4.5rem); line-height: 1.05; }
.hero h1 .accent { color: var(--clay); }
.hero p.lead { color: var(--ink-dim); font-weight: 200; font-size: 1.25rem; margin: 1.2rem auto 2rem; max-width: 560px; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.steps { margin-top: 3rem; }
.step h3 { color: var(--clay); margin-bottom: 0.4rem; }
.step p { color: var(--ink-dim); font-weight: 200; font-size: 0.95rem; line-height: 1.5; }
.step .n { display: inline-flex; width: 2rem; height: 2rem; border-radius: 50%; background: var(--clay); color: var(--shadow); font-weight: 800; align-items: center; justify-content: center; margin-bottom: 0.8rem; }
.pricing { text-align: center; margin-top: 4rem; }
.price { font-size: 2.6rem; font-weight: 800; color: var(--clay); }
.price small { font-size: 1rem; color: var(--ink-dim); font-weight: 200; }
.plan ul { list-style: none; margin: 1rem 0 1.5rem; color: var(--ink-dim); font-weight: 200; line-height: 2; }
.plan.featured { border-color: var(--clay); }

/* auth */
.auth { max-width: 420px; margin: 3rem auto; }
.auth h1 { margin-bottom: 1.5rem; font-weight: 200; }

/* public txtme page */
.tpage { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; flex: 1; padding: 2rem 1rem; }
.tpage .who { font-size: clamp(1.8rem, 6vw, 2.8rem); font-weight: 700; }
.tpage .tagline { color: var(--clay); font-weight: 200; font-size: 1.2rem; margin: 0.4rem 0 2rem; }
.phone-row { display: flex; gap: 0.6rem; width: 100%; max-width: 380px; }
.phone-row input { flex: 1; font-size: 1.15rem; text-align: center; letter-spacing: 1px; }
.tiny { color: var(--ink-dim); font-size: 0.75rem; font-weight: 200; margin-top: 2rem; }

/* dashboard */
.page-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--shadow-3); }
.page-row:last-child { border-bottom: none; }
.page-row .slug { font-weight: 600; font-size: 1.1rem; }
.page-row .meta { color: var(--ink-dim); font-size: 0.85rem; font-weight: 200; }
.badge { font-size: 0.7rem; padding: 0.15rem 0.55rem; border-radius: 99px; text-transform: uppercase; letter-spacing: 1px; }
.badge.active { background: rgba(165,196,122,.15); color: var(--ok); }
.badge.disabled, .badge.blocked { background: rgba(217,123,108,.15); color: var(--danger); }
.badge.pro { background: rgba(212,170,125,.18); color: var(--clay); }
.badge.free { background: var(--shadow-3); color: var(--ink-dim); }

/* editor + preview */
.preview-phone {
  background: var(--shadow-2); border: 1px solid var(--shadow-3); border-radius: 28px;
  padding: 1.2rem; max-width: 320px; margin: 0 auto;
}
.bubble {
  background: #3b3b3b; color: var(--ink); border-radius: 18px 18px 18px 4px;
  padding: 0.7rem 0.95rem; font-size: 0.95rem; line-height: 1.45;
  white-space: pre-wrap; word-wrap: break-word; text-align: left;
  font-family: -apple-system, 'Segoe UI', sans-serif;
}
.seg-info { text-align: center; font-size: 0.8rem; color: var(--ink-dim); margin-top: 0.8rem; }
.seg-info.warn { color: var(--danger); }
.qr-box { text-align: center; }
.qr-box img { width: 100%; max-width: 260px; border-radius: var(--radius); background: #fff; padding: 8px; }

/* tables (admin) */
.tbl { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.tbl th { text-align: left; color: var(--ink-dim); font-weight: 600; text-transform: uppercase; font-size: 0.7rem; letter-spacing: 1px; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--shadow-3); }
.tbl td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--shadow-3); vertical-align: middle; }
.tbl-wrap { overflow-x: auto; }
.stat { text-align: center; }
.stat .v { font-size: 2rem; font-weight: 800; color: var(--clay); }
.stat .k { color: var(--ink-dim); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; }
.mt { margin-top: 1.5rem; } .mt2 { margin-top: 2.5rem; }
h2.section { font-weight: 200; margin-bottom: 1rem; }
.actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
