/* Vanilla CSS with custom-properties for per-branch branding. The portal sets
   --primary from the GET /portal/session response. */

:root {
  --primary: #2563eb;
  --ink: #111;
  --ink-2: #555;
  --line: #e5e7eb;
  --bg: #f8fafc;
  --bg-card: #fff;
  --danger: #c83f4d;
  --warning: #b8860b;
  --success: #4caf85;
  --radius: 8px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
main { max-width: 640px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { margin: 0 0 8px; font-size: 22px; }
.muted { color: var(--ink-2); font-size: 14px; }
.hidden { display: none !important; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.brand-header {
  display: flex; align-items: center; gap: 20px;
  padding: 16px 0 20px;
}
.brand-header img {
  max-height: 72px; max-width: 220px; object-fit: contain;
  flex: 0 0 auto;
}
.brand-header img[src=""] { display: none; }
.brand-header-text {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.brand-header-text strong {
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  letter-spacing: 0.02em;
}
.brand-header-text .muted {
  font-size: 15px; color: var(--ink); font-weight: 500;
}

@media (max-width: 480px) {
  .brand-header { gap: 12px; }
  .brand-header img { max-height: 56px; max-width: 160px; }
  .brand-header-text strong { font-size: 12px; }
  .brand-header-text .muted { font-size: 14px; }
}

.btn-primary, .btn-secondary {
  font: inherit; cursor: pointer; padding: 10px 16px;
  border-radius: 6px; border: 1px solid transparent;
}
.btn-primary {
  background: var(--primary); color: white; border-color: var(--primary);
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  background: white; color: var(--ink); border-color: var(--line);
}

.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.addon-tile {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
  transition: border-color 0.15s ease;
}
.addon-tile.selected { border-color: var(--primary); background: rgba(37, 99, 235, 0.03); }
.addon-tile.unavailable { opacity: 0.55; }

.addon-row {
  display: flex; align-items: flex-start; gap: 10px;
}
.addon-row input[type="checkbox"] { margin-top: 4px; }
.addon-body { flex: 1; }
.addon-meta { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.addon-price { font-weight: 600; }

.fields { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.fields label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.fields input[type="text"], .fields input[type="email"], .fields input[type="tel"], .fields select, .fields textarea {
  font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px;
}
.fields .required-marker { color: var(--danger); }

#validationCard { border-color: var(--danger); }
#validationCard ul { margin: 6px 0 0; padding-left: 20px; font-size: 14px; }

.footer { margin-top: 16px; padding: 0 4px; }
