/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ──────────────────────────────────────────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: #f1f5f9;
  color: #0f172a;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
.page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 56px 20px 80px;
}

.card {
  background: #ffffff;
  border-radius: 14px;
  padding: 40px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 20px rgba(0,0,0,.08);
}

.card.wide  { max-width: 580px; }
.card.center { text-align: center; }

/* ── Brand header ──────────────────────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-star {
  font-size: 28px;
  color: #f59e0b;
  line-height: 1;
  flex-shrink: 0;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.brand-sub {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 2px;
}

/* ── Typography ────────────────────────────────────────────────────────────── */
h1 {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
}

.body-text {
  font-size: 15px;
  line-height: 1.65;
  color: #475569;
  margin-bottom: 28px;
}

.fine-print {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.55;
  margin-top: 16px;
  text-align: center;
}

/* ── Form fields ───────────────────────────────────────────────────────────── */
.field { margin-bottom: 20px; }

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  margin-bottom: 6px;
}

input, textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
  color: #0f172a;
  background: #fff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}

input:focus, textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
}

input:disabled, textarea:disabled {
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
}

textarea {
  resize: vertical;
  line-height: 1.6;
  min-height: 140px;
}

.char-count {
  display: block;
  font-size: 12px;
  color: #94a3b8;
  text-align: right;
  margin-top: 5px;
}

.char-warn { color: #f59e0b; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: #1d4ed8;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  margin-top: 4px;
  text-decoration: none;
}

.btn-primary:hover:not(:disabled) { background: #1e40af; }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.btn-ghost {
  display: block;
  width: 100%;
  padding: 10px;
  font-size: 14px;
  font-family: inherit;
  color: #94a3b8;
  background: transparent;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s;
  margin-top: 16px;
  text-align: center;
  text-decoration: none;
}

.btn-ghost:hover {
  background: #f8fafc;
  color: #64748b;
}

/* ── Status / alerts ───────────────────────────────────────────────────────── */
.connected-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #15803d;
  margin-bottom: 24px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.alert-notice {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* ── Connected info block ──────────────────────────────────────────────────── */
.info-block {
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 24px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 14px;
  font-size: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.info-row:last-child { border-bottom: none; }

.info-label {
  color: #94a3b8;
  flex-shrink: 0;
}

.info-value {
  color: #334155;
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}

/* ── Edit page ─────────────────────────────────────────────────────────────── */
.edit-eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
  margin-bottom: 16px;
}

.reviewer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.reviewer-name {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}

.stars {
  font-size: 16px;
  color: #f59e0b;
  letter-spacing: 2px;
}

.stars-empty { color: #e2e8f0; }

.review-quote {
  font-size: 15px;
  line-height: 1.65;
  color: #475569;
  font-style: italic;
  border-left: 3px solid #e2e8f0;
  padding-left: 14px;
  margin-bottom: 28px;
}

.review-no-text {
  font-size: 14px;
  color: #94a3b8;
  font-style: italic;
  margin-bottom: 28px;
}

/* ── Success / check icon ──────────────────────────────────────────────────── */
.check-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: #f0fdf4;
  border: 2px solid #bbf7d0;
  border-radius: 50%;
  font-size: 24px;
  color: #16a34a;
  margin: 0 auto 20px;
}

/* ── Spinner ───────────────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .page { padding: 24px 16px 60px; }
  .card { padding: 28px 24px; }
}
