/* Phase 10 — Interactive Business Website Builder UI */
:root {
  --p10-accent: #2563EB;
  --p10-accent-hover: #1D4ED8;
  --p10-accent-light: #EFF6FF;
  --p10-text: #111827;
  --p10-text2: #6B7280;
  --p10-bg: #FFFFFF;
  --p10-surface: #F9FAFB;
  --p10-border: #E5E7EB;
  --p10-radius: 10px;
  --p10-shadow: 0 1px 4px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --p10-max: 960px;
  --p10-success: #16A34A;
  --p10-warn: #D97706;
  --p10-danger: #DC2626;
  --p10-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--p10-font);
  color: var(--p10-text);
  background: var(--p10-bg);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Layout ── */
.p10-nav {
  background: white;
  border-bottom: 1px solid var(--p10-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.p10-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--p10-max);
  margin: 0 auto;
  padding: 14px 16px;
  gap: 12px;
}
.p10-logo {
  font-weight: 700;
  font-size: 17px;
  color: var(--p10-accent);
  text-decoration: none;
  white-space: nowrap;
}
.p10-logo-sub {
  font-size: 12px;
  color: var(--p10-text2);
  font-weight: 400;
  display: block;
}
.p10-nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
}
.p10-nav-links a {
  font-size: 14px;
  color: var(--p10-text2);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: 500;
}
.p10-nav-links a:hover { background: var(--p10-surface); color: var(--p10-text); }
.p10-nav-links a.active { color: var(--p10-accent); }

.p10-container {
  max-width: var(--p10-max);
  margin: 0 auto;
  padding: 0 16px;
}

/* ── Buttons ── */
.p10-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s;
  line-height: 1.4;
  white-space: nowrap;
}
.p10-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.p10-btn-primary { background: var(--p10-accent); color: white; }
.p10-btn-primary:hover:not(:disabled) { background: var(--p10-accent-hover); }
.p10-btn-secondary { background: var(--p10-surface); color: var(--p10-text); border: 1px solid var(--p10-border); }
.p10-btn-secondary:hover:not(:disabled) { background: var(--p10-border); }
.p10-btn-outline { background: transparent; color: var(--p10-accent); border: 2px solid var(--p10-accent); }
.p10-btn-outline:hover:not(:disabled) { background: var(--p10-accent-light); }
.p10-btn-danger { background: var(--p10-danger); color: white; }
.p10-btn-sm { padding: 7px 14px; font-size: 13px; }
.p10-btn-lg { padding: 14px 32px; font-size: 17px; }
.p10-btn-full { width: 100%; }

/* ── Cards ── */
.p10-card {
  background: white;
  border: 1px solid var(--p10-border);
  border-radius: var(--p10-radius);
  padding: 24px;
  box-shadow: var(--p10-shadow);
}
.p10-card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.p10-card-sub {
  font-size: 14px;
  color: var(--p10-text2);
  margin-bottom: 20px;
}

/* ── Forms ── */
.p10-form-group { margin-bottom: 18px; }
.p10-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--p10-text);
}
.p10-label .required { color: var(--p10-danger); margin-left: 2px; }
.p10-input, .p10-select, .p10-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--p10-border);
  border-radius: 8px;
  font-size: 15px;
  color: var(--p10-text);
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: var(--p10-font);
}
.p10-input:focus, .p10-select:focus, .p10-textarea:focus {
  outline: none;
  border-color: var(--p10-accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.p10-input.error, .p10-select.error, .p10-textarea.error {
  border-color: var(--p10-danger);
}
.p10-input.error:focus, .p10-select.error:focus, .p10-textarea.error:focus {
  box-shadow: 0 0 0 3px rgba(220,38,38,0.12);
}
.p10-field-error {
  font-size: 12px;
  color: var(--p10-danger);
  margin-top: 4px;
  display: none;
}
.p10-field-error.visible { display: block; }
.p10-textarea { resize: vertical; min-height: 80px; }
.p10-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .p10-form-grid { grid-template-columns: 1fr; } }

/* ── Hero / Landing ── */
.p10-hero {
  background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 60%, #3B82F6 100%);
  color: white;
  padding: 64px 16px 56px;
  text-align: center;
}
.p10-hero h1 {
  font-size: clamp(26px, 5vw, 46px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 14px;
  letter-spacing: -0.5px;
}
.p10-hero h1 em { font-style: normal; color: #93C5FD; }
.p10-hero-sub {
  font-size: clamp(15px, 2.5vw, 19px);
  opacity: 0.88;
  max-width: 600px;
  margin: 0 auto 36px;
  line-height: 1.6;
}
.p10-entry-box {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 560px;
  margin: 0 auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.p10-url-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.p10-url-row .p10-input { flex: 1; color: var(--p10-text); }
.p10-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--p10-text2);
  font-size: 13px;
  margin: 12px 0;
}
.p10-divider::before, .p10-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--p10-border);
}

/* ── Steps / progress ── */
.p10-steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 32px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.p10-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 80px;
  position: relative;
}
.p10-step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--p10-border);
  background: white;
  color: var(--p10-text2);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: all 0.3s;
  flex-shrink: 0;
}
.p10-step.active .p10-step-circle { border-color: var(--p10-accent); background: var(--p10-accent); color: white; }
.p10-step.done .p10-step-circle { border-color: var(--p10-success); background: var(--p10-success); color: white; }
.p10-step.error .p10-step-circle { border-color: var(--p10-danger); background: var(--p10-danger); color: white; }
.p10-step-label { font-size: 11px; color: var(--p10-text2); text-align: center; margin-top: 6px; line-height: 1.3; }
.p10-step.active .p10-step-label { color: var(--p10-accent); font-weight: 600; }
.p10-step.done .p10-step-label { color: var(--p10-success); }
.p10-step::before {
  content: '';
  position: absolute;
  top: 15px;
  right: 50%;
  left: -50%;
  height: 2px;
  background: var(--p10-border);
  z-index: 0;
}
.p10-step:first-child::before { display: none; }
.p10-step.done::before, .p10-step.active::before { background: var(--p10-accent); }

/* ── Progress phase list ── */
.p10-phase-list { list-style: none; padding: 0; margin-bottom: 24px; }
.p10-phase-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--p10-surface);
  transition: all 0.3s;
}
.p10-phase-item.active { background: var(--p10-accent-light); border: 1px solid rgba(37,99,235,0.2); }
.p10-phase-item.done { background: #F0FDF4; border: 1px solid rgba(22,163,74,0.2); }
.p10-phase-item.error { background: #FEF2F2; border: 1px solid rgba(220,38,38,0.2); }
.p10-phase-icon { font-size: 18px; width: 28px; text-align: center; flex-shrink: 0; }
.p10-phase-text { flex: 1; }
.p10-phase-name { font-weight: 600; font-size: 14px; }
.p10-phase-detail { font-size: 12px; color: var(--p10-text2); margin-top: 2px; }
.p10-phase-item.active .p10-phase-detail { color: var(--p10-accent); }

/* ── Tabs ── */
.p10-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--p10-border); margin-bottom: 20px; overflow-x: auto; flex-wrap: nowrap; }
.p10-tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--p10-text2);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: all 0.15s;
}
.p10-tab:hover { color: var(--p10-text); }
.p10-tab.active { color: var(--p10-accent); border-bottom-color: var(--p10-accent); }

/* ── Status badges ── */
.p10-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.p10-badge-success { background: #DCFCE7; color: #166534; }
.p10-badge-warn { background: #FEF9C3; color: #854D0E; }
.p10-badge-danger { background: #FEE2E2; color: #991B1B; }
.p10-badge-info { background: var(--p10-accent-light); color: #1E40AF; }
.p10-badge-neutral { background: var(--p10-surface); color: var(--p10-text2); border: 1px solid var(--p10-border); }

/* ── Gate scores ── */
.p10-gate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.p10-gate-item {
  padding: 14px;
  border-radius: 8px;
  background: var(--p10-surface);
  border: 1px solid var(--p10-border);
}
.p10-gate-item.pass { border-color: rgba(22,163,74,0.3); background: #F0FDF4; }
.p10-gate-item.fail { border-color: rgba(220,38,38,0.3); background: #FEF2F2; }
.p10-gate-label { font-size: 12px; font-weight: 600; color: var(--p10-text2); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.p10-gate-score { font-size: 24px; font-weight: 800; color: var(--p10-text); margin-bottom: 4px; }
.p10-gate-item.pass .p10-gate-score { color: var(--p10-success); }
.p10-gate-item.fail .p10-gate-score { color: var(--p10-danger); }
.p10-gate-verdict { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.p10-gate-detail { font-size: 12px; color: var(--p10-text2); margin-top: 4px; }

/* ── Violation cards ── */
.p10-violation {
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 10px;
  border-left: 4px solid;
}
.p10-violation-hard { border-color: var(--p10-danger); background: #FEF2F2; }
.p10-violation-soft { border-color: var(--p10-warn); background: #FFFBEB; }
.p10-violation-title { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.p10-violation-hard .p10-violation-title { color: var(--p10-danger); }
.p10-violation-soft .p10-violation-title { color: var(--p10-warn); }
.p10-violation-detail { font-size: 13px; color: var(--p10-text2); }

/* ── Dashboard list ── */
.p10-biz-list { display: flex; flex-direction: column; gap: 12px; }
.p10-biz-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: white;
  border: 1px solid var(--p10-border);
  border-radius: var(--p10-radius);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  color: inherit;
}
.p10-biz-row:hover { border-color: var(--p10-accent); box-shadow: 0 2px 8px rgba(37,99,235,0.08); }
.p10-biz-icon { font-size: 32px; width: 48px; text-align: center; flex-shrink: 0; }
.p10-biz-info { flex: 1; min-width: 0; }
.p10-biz-name { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p10-biz-meta { font-size: 13px; color: var(--p10-text2); margin-top: 2px; }
.p10-biz-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Website preview iframe ── */
.p10-preview-frame {
  width: 100%;
  height: 600px;
  border: 1px solid var(--p10-border);
  border-radius: var(--p10-radius);
  background: white;
}
.p10-preview-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* ── Interactive layer preview (in results) ── */
.p10-il-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.p10-il-slot {
  border: 1px solid var(--p10-border);
  border-radius: 8px;
  overflow: hidden;
}
.p10-il-slot-head {
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
}
.p10-il-slot-head.live { background: #2563EB; }
.p10-il-slot-head.placeholder { background: #6B7280; }
.p10-il-slot-body { padding: 12px 14px; font-size: 13px; color: var(--p10-text2); }

/* ── Alerts ── */
.p10-alert {
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.p10-alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.p10-alert-info { background: var(--p10-accent-light); border: 1px solid rgba(37,99,235,0.2); color: #1E40AF; }
.p10-alert-success { background: #F0FDF4; border: 1px solid rgba(22,163,74,0.2); color: #166534; }
.p10-alert-warn { background: #FFFBEB; border: 1px solid rgba(217,119,6,0.2); color: #92400E; }
.p10-alert-danger { background: #FEF2F2; border: 1px solid rgba(220,38,38,0.2); color: #991B1B; }

/* ── Loading spinner ── */
.p10-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(37,99,235,0.2);
  border-top-color: var(--p10-accent);
  border-radius: 50%;
  animation: p10-spin 0.7s linear infinite;
  vertical-align: middle;
  flex-shrink: 0;
}
@keyframes p10-spin { to { transform: rotate(360deg); } }
.p10-spinner-lg { width: 40px; height: 40px; border-width: 3px; }

/* ── Progress bar ── */
.p10-progress { height: 6px; background: var(--p10-border); border-radius: 99px; overflow: hidden; margin-bottom: 8px; }
.p10-progress-bar { height: 100%; background: var(--p10-accent); border-radius: 99px; transition: width 0.5s; }

/* ── Misc ── */
.p10-page { padding: 40px 16px; }
.p10-page-title { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.p10-page-sub { font-size: 15px; color: var(--p10-text2); margin-bottom: 28px; }
.p10-section-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--p10-border); }
.p10-empty { text-align: center; padding: 60px 24px; color: var(--p10-text2); }
.p10-empty-icon { font-size: 48px; margin-bottom: 12px; }
.p10-empty h3 { font-size: 18px; font-weight: 600; color: var(--p10-text); margin-bottom: 8px; }
.p10-empty p { font-size: 14px; margin-bottom: 20px; }
.hidden { display: none !important; }

/* ── Marketing channel content ── */
.p10-channel-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--p10-text);
  white-space: pre-wrap;
  background: var(--p10-surface);
  border: 1px solid var(--p10-border);
  border-radius: 8px;
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
}
.p10-copy-btn {
  font-size: 12px;
  padding: 4px 10px;
  margin-left: 8px;
  cursor: pointer;
  background: var(--p10-surface);
  border: 1px solid var(--p10-border);
  border-radius: 6px;
  font-family: var(--p10-font);
  transition: all 0.15s;
}
.p10-copy-btn:hover { background: var(--p10-border); }

/* ── Tier badge ── */
.p10-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.p10-tier-professional { background: #EFF6FF; color: #1D4ED8; }
.p10-tier-premium { background: #FEF9C3; color: #713F12; border: 1px solid #F59E0B; }

/* ── Mobile overrides ── */
@media (max-width: 640px) {
  .p10-hero { padding: 40px 16px 36px; }
  .p10-page { padding: 24px 16px; }
  .p10-card { padding: 16px; }
  .p10-page-title { font-size: 22px; }
  .p10-tabs { gap: 0; }
  .p10-tab { padding: 10px 12px; font-size: 12px; }
  .p10-preview-frame { height: 400px; }
  .p10-biz-actions { display: none; }
  .p10-gate-grid { grid-template-columns: 1fr 1fr; }
}
