/* Styles for the login page, the three portals and the blog. Uses the variables from /styles.css. */
textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.loading { padding: 40px 0; color: var(--muted); }
.form-error { color: #b3261e; font-size: 14px; min-height: 1.4em; margin: 0; }
.btn-line { border-color: #cfcdc2; background: #fff; color: var(--text); }
.btn-line:hover { border-color: var(--ink); }
.btn-block { width: 100%; padding: 14px; font-size: 16px; }
.btn-mini { display: inline-flex; align-items: center; padding: 6px 10px; border: 1px solid #cfcdc2; background: #fff; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.btn-mini:hover { border-color: var(--ink); }
.btn-mini.danger { color: #b3261e; }
.footer-slim { padding: 24px 0; }
.footer-slim .foot-bottom { margin-top: 0; padding-top: 0; border: 0; }
.footer-slim .disclaimer { margin-top: 12px; }
.footer-slim a:hover { text-decoration: underline; }

/* ---------- login ---------- */
.login-wrap { min-height: calc(100vh - 200px); display: grid; place-items: center; padding: 48px 20px;
  background: radial-gradient(700px 400px at 80% 0%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 60%), var(--bg); }
.login-card { width: min(460px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 34px; }
.login-card h1 { font-family: var(--head); font-size: 30px; letter-spacing: -.02em; color: var(--ink); }
.login-card .muted { margin: 6px 0 20px; font-size: 14.500px; }
.login-card form { display: grid; gap: 8px; }
.login-card label { font-size: 13.500px; font-weight: 600; margin-top: 6px; }
.login-card input { padding: 12px 14px; border: 1px solid #cfcdc2; border-radius: 10px; font-size: 16px; }
.demo { margin-top: 24px; }
.demo > p { display: flex; align-items: center; gap: 12px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--gold-deep); }
.demo > p::before, .demo > p::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.demo-btns { display: grid; gap: 8px; margin-top: 12px; }
.btn-demo { justify-content: space-between; text-align: left; background: var(--gold-soft); border-color: #ecdcae; color: var(--text); padding: 12px 16px; }
.btn-demo:hover { border-color: var(--gold); }
.btn-demo small { font-weight: 500; color: var(--muted); font-size: 13px; }

/* ---------- portal layout ---------- */
.page-portal { background: #f3f2ec; }
.portal { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; width: min(1300px, 100% - 40px); margin: 0 auto; padding: 28px 0 64px; min-height: 70vh; align-items: start; }
.side { position: sticky; top: 100px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 12px; display: grid; gap: 6px; }
.side-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--gold-deep); padding: 4px 10px 8px; }
.side nav { display: grid; gap: 2px; }
.side nav a { padding: 10px 12px; border-radius: 9px; font-weight: 600; font-size: 14.500px; color: var(--text); }
.side nav a:hover { background: #f3f2ec; }
.side nav a.on { background: var(--ink); color: #fff; }
.side-out { margin-top: 8px; padding: 10px 12px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font-weight: 600; font-size: 14px; color: var(--muted); }
.side-out:hover { color: var(--text); }
.portal-head { margin-bottom: 20px; }
.portal-head h1 { font-family: var(--head); font-size: clamp(24px, 3vw, 32px); letter-spacing: -.02em; color: var(--ink); line-height: 1.15; }
.portal-head p { color: var(--muted); margin-top: 4px; }
#view { display: grid; gap: 18px; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: grid; gap: 12px; min-width: 0; margin: 0; }
.panel h2, fieldset.panel legend { font-family: var(--head); font-size: 18px; letter-spacing: -.01em; color: var(--ink); }
fieldset.panel legend { float: left; width: 100%; padding: 0; }
fieldset.panel legend + * { clear: both; }
.panel h4 { font-family: var(--head); font-size: 14.500px; margin: 6px 0 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack { display: grid; gap: 18px; align-content: start; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: 18px; align-items: start; }
.split.editor { grid-template-columns: minmax(0, 1fr) 330px; }
.sticky, .preview { position: sticky; top: 100px; }
.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.bar.col { flex-direction: column; align-items: stretch; }
.forms { align-items: start; }

.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.field { display: grid; gap: 5px; align-content: start; font-size: 13.500px; }
.field.wide { grid-column: 1 / -1; }
.field > span { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.field small { color: var(--muted); font-size: 12.500px; }
.field input, .field select, .field textarea, .panel > textarea, td select, td input { width: 100%; padding: 10px 12px; border: 1px solid #cfcdc2; border-radius: 9px; background: #fff; font-size: 15px; min-width: 0; }
.field textarea, .panel > textarea { resize: vertical; line-height: 1.5; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 14px !important; }
.color { display: flex; gap: 8px; }
.color input[type=color] { width: 46px; height: 42px; padding: 3px; flex-shrink: 0; cursor: pointer; }
.count { font-style: normal; font-weight: 600; font-size: 12px; }
.count.ok, .score.ok { color: #12703f; } .count.warn, .score.warn { color: var(--gold-deep); } .count.bad, .score.bad { color: #b3261e; }

.preview { display: grid; gap: 8px; }
.preview iframe { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.500px; }
th { text-align: left; font-size: 11.500px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.off td:not(.actions) { opacity: .55; }
td select, td input { padding: 7px 9px; font-size: 14px; min-width: 130px; }
td select[data-stage] { margin-top: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #eeede6; color: var(--muted); white-space: nowrap; }
.pill.ok { background: #e3f4ea; color: #12703f; } .pill.warn { background: var(--gold-soft); color: var(--gold-deep); } .pill.bad { background: #fde8e6; color: #b3261e; }
.badge { background: var(--cta); color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 8px; vertical-align: middle; font-family: var(--body); }

/* SEO checker */
.score { float: right; font-size: 15px; }
.checks { display: grid; gap: 7px; font-size: 13.500px; }
.checks li { padding-left: 24px; position: relative; line-height: 1.4; }
.checks li::before { position: absolute; left: 0; top: 0; font-weight: 800; }
.checks li.ok::before { content: "✓"; color: #12703f; }
.checks li.bad::before { content: "✕"; color: #b3261e; }
.checks li.ok { color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; gap: 5px; }
.preview-box summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.preview-box .prose { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* stats, referral, progress */
.stats-row { display: grid; grid-template-columns: 1.500fr repeat(4, 1fr); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 2px; align-content: start; box-shadow: var(--shadow); }
.stat span { font-size: 12.500px; color: var(--muted); font-weight: 600; }
.stat b { font-family: var(--head); font-size: 24px; color: var(--ink); letter-spacing: -.02em; }
.stat small { font-size: 12px; color: var(--muted); }
.hero-stat { background: var(--ink); border-color: var(--ink); }
.hero-stat span, .hero-stat small { color: #c6d2d7; } .hero-stat b { color: var(--gold); font-size: 30px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; padding: 11px 12px; border: 1px solid #cfcdc2; border-radius: 9px; background: #f8f7f2; font-size: 15px; }
.progress { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; font-weight: 600; }
.progress li { padding: 3px 9px; border-radius: 999px; background: #eeede6; color: #8a8f8c; white-space: nowrap; }
.progress li.done { background: #e3f4ea; color: #12703f; }
.progress li.now { background: var(--ink); color: #fff; }
.pitch { white-space: pre-wrap; font-family: var(--body); font-size: 15px; background: #f8f7f2; border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 0; }

/* video */
.video { position: relative; aspect-ratio: 16 / 9; background: #0d1a20; border-radius: 12px; overflow: hidden; max-width: 860px; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video.empty { display: grid; place-items: center; text-align: center; padding: 20px; background: repeating-linear-gradient(135deg, #f3f2ec 0 14px, #eceae1 14px 28px); border: 1px dashed #cfcdc2; aspect-ratio: 16 / 6; }
.video.empty p { color: var(--muted); max-width: 30em; }

/* client tracker */
.attention { border: 2px solid var(--gold); }
.meter { height: 8px; border-radius: 99px; background: #eeede6; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--wa); border-radius: 99px; }
.milestones { display: grid; gap: 0; }
.milestones li { display: flex; gap: 14px; padding: 12px 0; position: relative; }
.milestones li:not(:last-child)::after { content: ""; position: absolute; left: 16px; top: 46px; bottom: -10px; width: 2px; background: #dcdacf; }
.milestones li.done:not(:last-child)::after { background: var(--wa); }
.dot { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: #eeede6; color: #8a8f8c; position: relative; z-index: 1; }
.milestones .done .dot { background: var(--wa); color: #fff; }
.milestones .now .dot { background: var(--ink); color: #fff; box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold) 45%, transparent); }
.milestones b { display: block; font-family: var(--head); font-size: 15.500px; color: var(--ink); }
.milestones small { color: var(--muted); font-size: 13px; }
.milestones .todo b { color: #8a8f8c; }
.doc-list { display: grid; }
.doc-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.doc-list li:last-child { border-bottom: 0; }
.doc-list a:not(.btn) { text-decoration: underline; }

/* modal + toast */
.modal { border: 0; border-radius: 16px; padding: 26px; width: min(640px, calc(100% - 32px)); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
.modal::backdrop { background: rgba(11, 29, 38, .55); }
.modal h3 { margin-bottom: 12px; padding-right: 30px; }
.modal-body { display: grid; gap: 12px; }
.modal-x { position: absolute; right: 14px; top: 12px; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); }
.add-doc { border-top: 1px solid var(--line); padding-top: 12px; gap: 10px; }
#toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px; font-weight: 600; font-size: 14.500px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 200; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: #b3261e; }

/* ---------- blog ---------- */
.blog-index, .article { padding: 56px 0 80px; }
.blog-index h1, .article h1 { font-family: var(--head); font-weight: 800; font-size: clamp(30px, 4.400vw, 46px); line-height: 1.1; letter-spacing: -.03em; color: var(--ink); }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin-top: 34px; }
.post-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; }
.post-card h2 { font-size: 21px; line-height: 1.25; letter-spacing: -.01em; }
.post-card h2 a:hover { text-decoration: underline; }
.post-card .link { margin-top: auto; }
.post-date { font-size: 13px !important; color: var(--muted); font-weight: 600; }
.crumbs { margin-bottom: 18px; font-weight: 600; font-size: 14.500px; color: var(--cta-dark); }
.article .post-date { margin: 14px 0 26px; }
.article .cover { width: 100%; border-radius: var(--radius); margin-bottom: 28px; }
.prose { font-size: 17.500px; line-height: 1.75; color: #24353c; }
.prose > * + * { margin-top: 1.100em; }
.prose h1 { font-family: var(--head); font-size: 30px; line-height: 1.2; color: var(--ink); }
.prose h2 { font-size: 27px; margin-top: 1.800em; }
.prose h3 { font-size: 20.500px; margin-top: 1.600em; }
.prose h4 { font-family: var(--head); font-size: 17px; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.400em; display: grid; gap: .4em; }
.prose ul { list-style: disc; } .prose ol { list-style: decimal; }
.prose a { color: var(--cta-dark); text-decoration: underline; text-underline-offset: 3px; }
.prose img { max-width: 100%; border-radius: 12px; }
.prose blockquote { margin: 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--gold); color: var(--muted); font-style: italic; }
.article-cta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-top: 48px; padding: 26px; border-radius: var(--radius); background: var(--ink); color: #fff; }
.article-cta h2 { color: #fff; font-size: 22px; } .article-cta p { color: #c6d2d7; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .split, .split.editor { grid-template-columns: 1fr; }
  .sticky, .preview { position: static; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .hero-stat { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .portal { grid-template-columns: 1fr; gap: 16px; padding-top: 16px; }
  .side { position: static; padding: 10px; }
  .side nav { display: flex; overflow-x: auto; }
  .side nav a { white-space: nowrap; }
  .side-label, .side-out { display: none; }
  .fields { grid-template-columns: 1fr; }
  .copy-row { flex-direction: column; }
}
