/* Styles for the server-rendered pages (reviews, portfolio, changelog, status, account,
   contact, dashboard) and the live sections on the home page. Builds on styles.css tokens. */

:root {
  --ok: #3fb37f;
  --warn: #d9a441;
  --bad: #e5484d;
  --none: #ffffff14;
}

.page { padding-top: 40px; padding-bottom: 80px; min-height: calc(100vh - 220px); }
.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: clamp(28px, 4vw, 38px); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 8px; }
.page-head p { margin: 0; color: var(--text-secondary); }
.sub-head { font-size: 20px; margin: 40px 0 14px; }
.muted { color: var(--text-tertiary); font-size: 13px; }
.fine-print { color: var(--text-tertiary); font-size: 12.5px; margin-top: 28px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

.nav-links a[aria-current="page"] { color: var(--text-primary); }
.nav-user { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.nav-user:hover { color: var(--text-primary); }
.nav-user img { border-radius: 50%; }

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.card h2 { font-size: 17px; margin: 0 0 14px; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card-image { display: block; width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px; margin: 12px 0; border: 1px solid var(--card-border); }
.empty { color: var(--text-secondary); padding: 28px; text-align: center; border: 1px dashed var(--card-border); border-radius: var(--radius); }
.empty code { background: #ffffff10; padding: 2px 6px; border-radius: 6px; }

.pager { display: flex; justify-content: space-between; margin-top: 24px; }

.notice { background: #3fb37f1a; border: 1px solid #3fb37f55; border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; font-size: 14px; }
.notice.warn { background: #d9a4411a; border-color: #d9a44155; }
.notice.error { background: #e5484d1a; border-color: #e5484d55; }

/* Reviews */
.stars { display: inline-flex; gap: 2px; }
.stars svg { display: block; fill: currentColor; }
.stars .on { color: #f2c94c; }
.stars .off { color: #ffffff26; }
.review-card { display: flex; flex-direction: column; }
.review-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.review-card h3 { font-size: 16px; margin: 0 0 6px; }
.review-body { color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 0 0 12px; white-space: pre-wrap; word-break: break-word; }
.review-author { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; }
.review-author strong { display: block; font-size: 13.5px; }
.review-avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; background: #ffffff14; }
.review-avatar-anon { display: inline-block; }

/* Portfolio */
.portfolio-card { padding: 12px; display: flex; flex-direction: column; }
.portfolio-card .card-image { margin: 0 0 12px; }
.portfolio-card .card-body { padding: 0 8px 8px; }
.portfolio-card h3 { font-size: 16px; margin: 0 0 6px; }
.portfolio-card p { color: var(--text-secondary); font-size: 14px; line-height: 1.55; margin: 0 0 10px; white-space: pre-wrap; word-break: break-word; }

/* Changelog */
.changelog-meta { display: flex; justify-content: space-between; color: var(--text-tertiary); font-size: 13px; }
.changelog-entry h2 { font-size: 20px; margin: 6px 0 14px; }
.changelog-section { margin-bottom: 12px; }
.changelog-section ul { margin: 8px 0 0; padding-left: 20px; color: var(--text-secondary); font-size: 14px; line-height: 1.7; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--card-border); }
.tag-added { color: var(--ok); border-color: #3fb37f55; }
.tag-removed { color: var(--bad); border-color: #e5484d55; }
.tag-changed { color: var(--warn); border-color: #d9a44155; }

/* Status */
.status-banner { border-radius: var(--radius); padding: 16px 20px; font-weight: 600; margin-bottom: 18px; }
.status-banner.up { background: #3fb37f1f; border: 1px solid #3fb37f55; }
.status-banner.down { background: #e5484d1f; border: 1px solid #e5484d55; }
.status-row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.bars { display: grid; grid-template-columns: repeat(90, 1fr); gap: 2px; height: 32px; }
.bar { border-radius: 2px; background: var(--none); }
.bar.ok { background: var(--ok); }
.bar.warn { background: var(--warn); }
.bar.bad { background: var(--bad); }
.status-row-foot { display: flex; justify-content: space-between; margin-top: 8px; }
.pill-status { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--card-border); color: var(--text-secondary); }
.pill-status.up { color: var(--ok); border-color: #3fb37f55; }
.pill-status.down { color: var(--bad); border-color: #e5484d55; }
.incident-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.incident-list li { background: var(--card); border: 1px solid var(--card-border); border-radius: 12px; padding: 12px 16px; font-size: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Account */
.account-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.account-head img { border-radius: 50%; }
.account-head h1 { margin: 0; font-size: 26px; }
.account-head p { margin: 2px 0 0; }
.account-actions { margin-left: auto; display: flex; gap: 10px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--card-border); font-size: 14px; }
.rows li:last-child { border-bottom: none; }
.rows li > span:first-child { flex: 1; min-width: 180px; }
.rows .note { flex-basis: 100%; color: var(--text-secondary); font-size: 13px; }

/* Contact */
.contact-card { max-width: 640px; display: flex; flex-direction: column; gap: 16px; }
.contact-card p { margin: 0; color: var(--text-secondary); }
.contact-card label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.contact-card select, .contact-card textarea {
  font: inherit; font-weight: 400; color: var(--text-primary); background: #0e0e0d; border: 1px solid var(--card-border);
  border-radius: 12px; padding: 11px 13px;
}
.contact-card select:focus, .contact-card textarea:focus { outline: 2px solid #ffffff; outline-offset: 1px; }
.contact-card .btn { align-self: flex-start; }

/* Dashboard */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.tile { display: flex; flex-direction: column; gap: 4px; }
.tile strong { font-family: var(--font-display); font-size: 28px; }
.page > section.card { margin-bottom: 14px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.chart { width: 100%; height: auto; display: block; }
.chart .axis { fill: var(--text-tertiary); font-size: 11px; font-family: Inter, sans-serif; }
.chart .baseline { stroke: var(--card-border); }
.s-opened { fill: #ffffff; background: #ffffff; }
.s-closed { fill: #8a8a84; background: #8a8a84; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--text-secondary); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--text-tertiary); font-weight: 600; font-size: 12.5px; padding: 6px 8px; border-bottom: 1px solid var(--card-border); }
.table td { padding: 8px; border-bottom: 1px solid var(--card-border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr.is-hidden td { color: var(--text-tertiary); }
.table form { margin: 0; }

.message-page { text-align: center; max-width: 520px; margin: 60px auto; }
.message-page p { color: var(--text-secondary); margin-bottom: 24px; }

.page-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; max-width: 1200px; margin: 0 auto; padding: 24px; border-top: 1px solid var(--card-border); color: var(--text-tertiary); font-size: 13px; }
.page-footer a:hover { color: var(--text-primary); }

/* Home page: live stats + reviews (filled in by script.js; hidden until there's data) */
.live-section[hidden] { display: none; }
.live-stats .stat-value { font-family: var(--font-display); }
.home-reviews { padding: 0 24px 80px; }
.home-reviews .card-grid { max-width: 1080px; margin: 0 auto; }
.home-reviews .see-all { text-align: center; margin-top: 24px; }

@media (max-width: 860px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
  .nav-user span { display: none; }
}

@media (max-width: 520px) {
  .card-grid { grid-template-columns: 1fr; }
  .bars { gap: 1px; }
  .account-actions { margin-left: 0; }
  .table { font-size: 13px; }
}

/* keep the header on one line on phones */
.brand, .nav-cta .btn, .nav-user { white-space: nowrap; }
@media (max-width: 520px) {
  nav { padding: 10px 12px 10px 16px; }
  .brand { font-size: 16px; }
  .nav-cta { gap: 8px; }
  .nav-cta .btn { padding: 9px 14px; font-size: 13px; }
}

/* Pricing / Features / Setup pages */
.pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 8px; }
.price-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 28px 24px; position: relative; }
.price-card-featured { border-color: #ffffff40; }
.price-tag { position: absolute; top: -12px; left: 24px; background: #ffffff; color: #0e0e0d; font-size: 11.5px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.price-card h3 { font-size: 18px; margin: 0 0 16px; }
.price { display: flex; align-items: baseline; gap: 4px; margin-bottom: 6px; }
.price .amount { font-family: var(--font-display); font-size: 34px; font-weight: 800; }
.price .per { font-size: 14px; color: var(--text-secondary); }
.price-note { margin: 0 0 20px; font-size: 14px; color: var(--text-secondary); }
.price-list { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-direction: column; gap: 10px; }
.price-list li { font-size: 14px; padding-left: 22px; position: relative; color: var(--text-secondary); }
.price-list li::before {
  content: "";
  position: absolute; left: 0; top: 5px; width: 12px; height: 12px;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
}
.price-card .btn { width: 100%; justify-content: center; }
.pricing-foot { color: var(--text-tertiary); font-size: 13px; text-align: center; margin: 4px 0 40px; }
.pricing-compare table { min-width: 560px; }
.pricing-compare { overflow-x: auto; }

.features-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 16px 0 36px; }
.feature-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 22px; }
.feature-card h3 { font-size: 16px; margin: 0 0 8px; }
.feature-card p { margin: 0; font-size: 14px; color: var(--text-secondary); line-height: 1.55; }

.setup-step { display: flex; gap: 18px; align-items: flex-start; }
.setup-step-num {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: #ffffff; color: #0e0e0d;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.setup-step h3 { margin: 2px 0 6px; font-size: 16px; }
.setup-step p { margin: 0; font-size: 14px; color: var(--text-secondary); line-height: 1.65; }
.setup-step code { background: #ffffff10; padding: 2px 6px; border-radius: 6px; font-size: 13px; }

.cta-inline { text-align: center; margin-top: 36px; }
.cta-inline h2 { font-size: 20px; margin: 0 0 8px; }
.cta-inline p { margin: 0 0 18px; color: var(--text-secondary); font-size: 14px; }

@media (max-width: 860px) {
  .pricing-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
}

/* Order status page */
.order-status { display: flex; flex-direction: column; gap: 14px; max-width: 480px; }
.order-status-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--card-border); }
.order-status-row:last-child { border-bottom: none; padding-bottom: 0; }
.order-status-notes { padding-top: 4px; }
.order-status-notes p { margin: 6px 0 0; font-size: 14px; color: var(--text-secondary); white-space: pre-wrap; }
