/* ── Portal-specific styles (extends cth-brand.css) ─────────────────────── */

/* Hero */
.hero { text-align: center; padding: var(--sp-3xl) 0 var(--sp-2xl); }
.hero h1 { white-space: pre-line; margin-bottom: var(--sp-md); }
.hero-sub { max-width: 640px; margin: 0 auto var(--sp-xl); color: var(--cth-text-muted, #555); font-size: var(--fs-lg); line-height: 1.6; }
.hero-actions { margin-bottom: var(--sp-lg); }
.trust-row { display: flex; gap: var(--sp-md); justify-content: center; flex-wrap: wrap; }
.trust-badge { font-size: var(--fs-sm); color: var(--cth-forest-green); background: var(--cth-light-cyan); padding: var(--sp-xs) var(--sp-md); border-radius: var(--r-full); }

/* VRF Overview on welcome */
.vrf-overview { padding: var(--sp-2xl) 0; }
.vrf-overview h2 { text-align: center; margin-bottom: var(--sp-xl); }
.steps-preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--sp-md); }
.step-preview-card { text-align: center; padding: var(--sp-lg); background: white; border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.step-preview-card .step-icon { font-size: 2rem; display: block; margin-bottom: var(--sp-xs); }
.step-preview-card .step-number { font-size: var(--fs-sm); color: var(--cth-deep-blue); font-weight: 700; }

/* Intake */
.intake-section { max-width: 560px; margin: 0 auto; padding: var(--sp-2xl) 0; }
.intake-section h1 { margin-bottom: var(--sp-xs); }
.section-sub { color: var(--cth-text-muted, #555); margin-bottom: var(--sp-xl); }
.intake-form { display: flex; flex-direction: column; gap: var(--sp-lg); }

/* Alerts */
.alert { padding: var(--sp-md); border-radius: var(--r-md); margin-bottom: var(--sp-md); }
.alert-error { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.alert-warning { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.alert-locked { background: #f3f4f6; border: 1px solid #d1d5db; color: #6b7280; }

/* Dashboard */
.dashboard-header { padding: var(--sp-xl) 0 var(--sp-md); }
.dashboard-header h1 { margin-bottom: var(--sp-xs); }

.founder-profile-card {
  background: white;
  border-radius: var(--r-md);
  padding: var(--sp-md) var(--sp-lg);
  box-shadow: var(--shadow-sm);
  margin: var(--sp-md) 0 var(--sp-xl);
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}
.profile-info { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-sm); }
.profile-info strong { font-size: var(--fs-lg); color: var(--cth-deep-blue); }
.profile-meta { font-size: var(--fs-sm); color: var(--cth-text-muted, #555); }
.trl-badge, .adaptation-badge {
  font-size: var(--fs-xs);
  padding: 2px var(--sp-sm);
  border-radius: var(--r-full);
  font-weight: 600;
}
.trl-badge { background: var(--cth-light-cyan); color: var(--cth-deep-blue); }
.adaptation-badge { background: #dbeafe; color: #1e40af; }

/* Step cards */
.vrf-steps { display: flex; flex-direction: column; gap: var(--sp-lg); padding-bottom: var(--sp-3xl); }

.step-card {
  background: white;
  border-radius: var(--r-lg, 12px);
  padding: var(--sp-lg) var(--sp-xl);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--cth-deep-blue);
  transition: box-shadow 0.2s;
}
.step-card:hover { box-shadow: var(--shadow-md); }
.step-card.step-locked { opacity: 0.6; border-left-color: #d1d5db; }
.step-card.step-complete { border-left-color: var(--cth-forest-green); }
.step-card.step-trl_blocked, .step-card.step-ess_blocked { border-left-color: #f59e0b; }

.step-header { display: flex; align-items: center; gap: var(--sp-md); flex-wrap: wrap; margin-bottom: var(--sp-sm); }
.step-number-badge {
  background: var(--cth-deep-blue);
  color: white;
  padding: var(--sp-xs) var(--sp-md);
  border-radius: var(--r-full);
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
}
.step-number-badge.lg { font-size: var(--fs-md); padding: var(--sp-sm) var(--sp-lg); }
.step-title { flex: 1; margin: 0; font-size: var(--fs-lg); }

.step-status-badge {
  font-size: var(--fs-xs);
  padding: 2px var(--sp-sm);
  border-radius: var(--r-full);
  font-weight: 600;
}
.status-available { background: var(--cth-light-cyan); color: var(--cth-deep-blue); }
.status-locked { background: #f3f4f6; color: #6b7280; }
.status-complete { background: #dcfce7; color: #166534; }
.status-in_progress { background: #fef3c7; color: #92400e; }
.status-trl_blocked, .status-ess_blocked { background: #fef3c7; color: #92400e; }

.step-description { color: var(--cth-text-muted, #555); margin-bottom: var(--sp-md); font-size: var(--fs-sm); }

/* Tools in step card */
.step-tools { display: flex; flex-direction: column; gap: var(--sp-sm); margin-bottom: var(--sp-md); }
.tool-item {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  background: #f9fafb;
  border-radius: var(--r-sm);
}
.tool-item.tool-completed { background: #f0fdf4; }
.tool-icon { font-size: 1.2rem; }
.tool-name { flex: 1; font-size: var(--fs-sm); font-weight: 500; }
.tool-check { font-size: var(--fs-xs); color: var(--cth-forest-green); font-weight: 600; }

/* Progress bar */
.step-progress-bar {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: var(--sp-xs);
}
.progress-fill { height: 100%; background: var(--cth-forest-green); border-radius: 2px; transition: width 0.3s; }
.step-progress-text { font-size: var(--fs-xs); color: var(--cth-text-muted, #555); }

/* Step detail page */
.step-detail { padding: var(--sp-xl) 0 var(--sp-3xl); }
.back-link { display: inline-block; margin-bottom: var(--sp-lg); color: var(--cth-deep-blue); text-decoration: none; font-size: var(--fs-sm); }
.back-link:hover { text-decoration: underline; }
.step-detail-header { margin-bottom: var(--sp-xl); }
.step-detail-desc { color: var(--cth-text-muted, #555); margin-top: var(--sp-sm); font-size: var(--fs-md); }
.tools-heading { margin-bottom: var(--sp-lg); }

.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--sp-lg); }
.tool-card {
  background: white;
  border-radius: var(--r-md);
  padding: var(--sp-xl);
  box-shadow: var(--shadow-sm);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-md);
}
.tool-card-completed { background: #f0fdf4; border: 1px solid #bbf7d0; }
.tool-card-icon { font-size: 2.5rem; }
.tool-card h3 { margin: 0; font-size: var(--fs-md); }
.tool-done-label { color: var(--cth-forest-green); font-weight: 600; font-size: var(--fs-sm); }

/* Buttons */
.btn { display: inline-block; padding: var(--sp-sm) var(--sp-lg); border-radius: var(--r-md); font-weight: 600; text-decoration: none; cursor: pointer; border: none; font-size: var(--fs-sm); transition: background 0.2s, box-shadow 0.2s; }
.btn-primary { background: var(--cth-deep-blue); color: white; }
.btn-primary:hover { background: #0a3a6e; box-shadow: var(--shadow-md); }
.btn-lg { padding: var(--sp-md) var(--sp-xl); font-size: var(--fs-md); }
.btn-sm { padding: var(--sp-xs) var(--sp-md); font-size: var(--fs-xs); }
.btn-outline { background: transparent; border: 1px solid var(--cth-deep-blue); color: var(--cth-deep-blue); }
.btn-outline:hover { background: var(--cth-light-cyan); }

/* SUI Score Card */
.sui-score-card {
  background: white;
  border-radius: var(--r-lg, 12px);
  padding: var(--sp-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--sp-xl);
  border-left: 4px solid var(--cth-forest-green);
}
.sui-header {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
  margin-bottom: var(--sp-lg);
}
.sui-composite {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--cth-deep-blue);
  line-height: 1;
}
.sui-max { font-size: 1rem; color: var(--cth-text-muted, #555); font-weight: 400; }
.sui-designation {
  font-weight: 700;
  font-size: var(--fs-md);
  padding: 2px var(--sp-sm);
  border-radius: var(--r-full);
  display: inline-block;
  margin-bottom: var(--sp-xs);
}
.sui-sui_emerging { background: #fef3c7; color: #92400e; }
.sui-sui_developing { background: #dbeafe; color: #1e40af; }
.sui-sui_advancing { background: #dcfce7; color: #166534; }
.sui-sui_verified { background: #d1fae5; color: #065f46; }
.sui-improve { font-size: var(--fs-sm); color: var(--cth-text-muted, #555); }

.sui-bars { display: flex; flex-direction: column; gap: var(--sp-sm); margin-bottom: var(--sp-lg); }
.sui-bar-row { display: flex; align-items: center; gap: var(--sp-sm); }
.sui-bar-label { width: 130px; font-size: var(--fs-sm); font-weight: 500; text-align: right; flex-shrink: 0; }
.sui-bar-track { flex: 1; height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; }
.sui-bar-fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.sui-bar-fill.level-0 { background: #d1d5db; }
.sui-bar-fill.level-1 { background: #fbbf24; }
.sui-bar-fill.level-2 { background: #60a5fa; }
.sui-bar-fill.level-3 { background: #34d399; }
.sui-bar-fill.level-4 { background: #059669; }
.sui-bar-level { font-size: var(--fs-xs); font-weight: 700; color: var(--cth-text-muted, #555); width: 28px; }

.sui-capital { margin-top: var(--sp-sm); }
.sui-capital-label { font-size: var(--fs-sm); font-weight: 600; color: var(--cth-deep-blue); display: block; margin-bottom: var(--sp-sm); }
.sui-capital-badges { display: flex; flex-wrap: wrap; gap: var(--sp-xs); }
.sui-capital-badge {
  font-size: var(--fs-xs);
  padding: 2px var(--sp-sm);
  background: var(--cth-light-cyan);
  color: var(--cth-deep-blue);
  border-radius: var(--r-full);
  font-weight: 500;
}

/* SUI Intake */
.sui-intake-card {
  background: white;
  border-radius: var(--r-lg, 12px);
  padding: var(--sp-xl);
  box-shadow: var(--shadow-sm);
  margin-top: var(--sp-xl);
}
.sui-intake-card h2, .sui-intake-card h3 { margin-bottom: var(--sp-xs); }
.sui-intake-card .hint { color: var(--cth-text-muted, #555); font-size: var(--fs-sm); margin-bottom: var(--sp-lg); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-md); }
.check-item { display: flex; align-items: center; gap: var(--sp-sm); font-size: var(--fs-sm); cursor: pointer; }
.check-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--cth-forest-green); }

/* Verifiability */
.verif-uploads { display: flex; flex-direction: column; gap: var(--sp-lg); margin-bottom: var(--sp-xl); }
.verif-upload-item { display: flex; flex-direction: column; gap: var(--sp-xs); }
.verif-upload-item p { font-size: var(--fs-sm); font-weight: 500; margin: 0; }
.verif-upload-item form { display: flex; align-items: center; gap: var(--sp-sm); }

/* Admin SUI Registry */
.sui-registry-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.sui-registry-table th { background: #f9fafb; padding: var(--sp-sm) var(--sp-md); text-align: left; font-weight: 600; border-bottom: 2px solid #e5e7eb; }
.sui-registry-table td { padding: var(--sp-sm) var(--sp-md); border-bottom: 1px solid #f3f4f6; }
.sui-registry-table tr:hover { background: #f9fafb; }
td.sui-composite-cell { font-weight: 700; text-align: center; }
td.green { color: #059669; }
td.blue { color: #2563eb; }
td.amber { color: #d97706; }
td.red { color: #dc2626; }
.badge-sui_emerging { background: #fef3c7; color: #92400e; padding: 2px 8px; border-radius: 99px; font-size: var(--fs-xs); font-weight: 600; }
.badge-sui_developing { background: #dbeafe; color: #1e40af; padding: 2px 8px; border-radius: 99px; font-size: var(--fs-xs); font-weight: 600; }
.badge-sui_advancing { background: #dcfce7; color: #166534; padding: 2px 8px; border-radius: 99px; font-size: var(--fs-xs); font-weight: 600; }
.badge-sui_verified { background: #d1fae5; color: #065f46; padding: 2px 8px; border-radius: 99px; font-size: var(--fs-xs); font-weight: 600; }
.btn-export { display: inline-block; margin-top: var(--sp-md); }

/* ── Registration / Login ─────────────────────────────────────────────────── */
.auth-section { max-width: 520px; margin: 0 auto; padding: var(--sp-2xl) var(--sp-lg); }
.auth-section h1 { font-size: var(--fs-xl); color: var(--cth-deep-blue); margin-bottom: var(--sp-xs); }
.auth-sub { font-size: var(--fs-sm); color: var(--cth-text-muted, #555); margin-bottom: var(--sp-xl); }

.oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-sm);
  width: 100%; padding: var(--sp-md); background: white; border: 1px solid #e2e8f0;
  border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: 500;
  text-decoration: none; color: var(--cth-text, #1e293b); margin-bottom: var(--sp-lg);
  cursor: pointer; transition: background 0.15s;
}
.oauth-btn:hover { background: #f8fafc; }
.oauth-btn svg { flex-shrink: 0; }

.auth-divider {
  display: flex; align-items: center; gap: var(--sp-md); margin-bottom: var(--sp-lg);
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: #e2e8f0;
}
.auth-divider span { font-size: var(--fs-xs); color: #94a3b8; }

.auth-form { display: flex; flex-direction: column; gap: var(--sp-md); }
.auth-form label { font-size: var(--fs-xs); font-weight: 600; color: #374151; display: block; margin-bottom: 4px; }
.auth-form input, .auth-form select {
  width: 100%; padding: var(--sp-sm) var(--sp-md); border: 1px solid #e2e8f0;
  border-radius: var(--r-md); font-size: var(--fs-sm); background: white;
}
.auth-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-md); }

.adaptation-hint {
  background: #f0fdf4; border: 1px solid #86efac; border-radius: var(--r-md);
  padding: var(--sp-md); display: none;
}
.adaptation-hint.show { display: block; }
.adaptation-hint label { display: flex; align-items: flex-start; gap: var(--sp-sm); cursor: pointer; }
.adaptation-hint .hint-text { font-size: var(--fs-sm); }
.adaptation-hint .hint-sub { font-size: var(--fs-xs); color: var(--cth-text-muted, #555); }

.auth-footer { font-size: var(--fs-xs); color: #94a3b8; text-align: center; margin-top: var(--sp-md); }
.auth-footer a { color: var(--cth-deep-blue); }

/* ── Dashboard Sidebar Layout ────────────────────────────────────────────── */
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--cth-deep-blue); color: white; padding: var(--sp-lg) 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.sidebar-logo { padding: 0 var(--sp-lg) var(--sp-lg); border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-logo .brand { font-size: var(--fs-sm); font-weight: 700; }
.sidebar-logo .company { font-size: var(--fs-xs); opacity: 0.6; font-weight: 400; }

.sidebar-section { padding: var(--sp-md) var(--sp-lg) 0; }
.sidebar-label {
  font-size: 10px; font-weight: 600; opacity: 0.5; text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: var(--sp-sm);
}

.step-nav-item {
  display: flex; align-items: center; gap: var(--sp-sm); padding: 9px var(--sp-md);
  border-radius: var(--r-md); margin-bottom: 2px; cursor: pointer; transition: background 0.15s;
  text-decoration: none; color: white;
}
.step-nav-item:hover { background: rgba(255,255,255,0.08); }
.step-nav-item.active { background: rgba(255,255,255,0.15); }
.step-nav-item.locked { opacity: 0.4; cursor: not-allowed; }
.step-nav-item.complete { background: rgba(34,197,94,0.15); }

.step-dot {
  width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.dot-complete { background: #22c55e; }
.dot-active { background: white; color: var(--cth-deep-blue); }
.dot-locked { background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.5); }

.step-nav-label { font-size: var(--fs-sm); font-weight: 500; }
.step-nav-sub { font-size: 11px; opacity: 0.6; }

/* SUI mini-widget */
.sui-mini {
  margin: var(--sp-md) var(--sp-lg) 0; background: rgba(255,255,255,0.08);
  border-radius: var(--r-md); padding: var(--sp-md);
}
.sui-mini-title { font-size: 11px; opacity: 0.7; margin-bottom: var(--sp-sm); }
.sui-mini-score { font-size: 1.5rem; font-weight: 700; }
.sui-mini-score .max { font-size: var(--fs-sm); opacity: 0.6; }
.sui-mini-label { font-size: 11px; opacity: 0.6; }
.sui-mini-bars { display: flex; gap: 3px; margin-top: var(--sp-sm); }
.sui-mini-bar { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.15); }
.sui-mini-bar.filled { background: #22c55e; }

.sidebar-footer {
  padding: var(--sp-md) var(--sp-lg); margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; gap: var(--sp-sm); align-items: center;
}
.sidebar-footer a { color: rgba(255,255,255,0.5); font-size: var(--fs-xs); text-decoration: none; font-weight: 400; }
.sidebar-footer a.active-lang { color: white; font-weight: 600; }

/* Main content */
.dash-main { padding: var(--sp-xl); min-width: 0; }
.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-xl); }
.dash-title { font-size: var(--fs-xl); font-weight: 700; }
.dash-subtitle { font-size: var(--fs-sm); color: var(--cth-text-muted, #555); }
.dash-header-right { display: flex; gap: var(--sp-sm); align-items: center; }
.dash-header-right a { font-size: var(--fs-sm); color: var(--cth-deep-blue); text-decoration: none; }
.dash-header-right .logout { color: #94a3b8; }

/* Step content panels */
.step-panel {
  background: white; border: 1px solid #e2e8f0; border-radius: var(--r-lg, 12px);
  padding: var(--sp-xl); display: none;
}
.step-panel.active { display: block; }

.step-heading { display: flex; align-items: center; gap: var(--sp-md); margin-bottom: var(--sp-lg); }
.step-badge {
  width: 36px; height: 36px; border-radius: 50%; background: var(--cth-deep-blue);
  color: white; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; flex-shrink: 0;
}
.step-panel-title { font-size: var(--fs-lg); font-weight: 700; }
.step-panel-desc { font-size: var(--fs-sm); color: var(--cth-text-muted, #555); }

/* Unlock toast */
.unlock-notice {
  background: #f0fdf4; border: 1px solid #86efac; border-radius: var(--r-md);
  padding: var(--sp-md); font-size: var(--fs-sm); color: #15803d;
  display: none; align-items: center; gap: var(--sp-sm); margin-bottom: var(--sp-lg);
}
.unlock-notice.show { display: flex; }

/* Profile summary grid */
.profile-grid {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: var(--r-md);
  padding: var(--sp-md); margin-bottom: var(--sp-lg);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-md);
}
.profile-grid .label { font-size: 11px; color: var(--cth-text-muted, #555); }
.profile-grid .value { font-weight: 600; }

/* SUI Banner on landing */
.sui-banner {
  background: linear-gradient(135deg, var(--cth-deep-blue) 0%, #1a6abf 100%);
  color: white; max-width: 900px; margin: 0 auto var(--sp-3xl);
  border-radius: var(--r-lg, 12px); padding: var(--sp-2xl);
  display: flex; gap: var(--sp-xl); align-items: center;
}
.sui-banner-text h2 { font-size: var(--fs-xl); font-weight: 700; margin-bottom: var(--sp-sm); }
.sui-banner-text p { font-size: var(--fs-sm); opacity: 0.85; }
.sui-score-preview {
  background: rgba(255,255,255,0.15); border-radius: var(--r-md);
  padding: var(--sp-md) var(--sp-lg); text-align: center; flex-shrink: 0;
}
.sui-score-preview .score { font-size: 2.5rem; font-weight: 700; }
.sui-score-preview .label { font-size: var(--fs-xs); opacity: 0.8; }

/* ── SUI Public Registry ─────────────────────────────────────────────────── */
.registry-section { max-width: 900px; margin: var(--sp-2xl) auto; padding: 0 var(--sp-lg); }
.registry-section h1 { margin-bottom: var(--sp-xs); }
.registry-section .section-sub { margin-bottom: var(--sp-xl); }
.registry-filters {
  display: flex; gap: var(--sp-sm); margin-bottom: var(--sp-lg); flex-wrap: wrap;
}
.registry-filters select, .registry-filters button {
  padding: var(--sp-sm) var(--sp-md); border: 1px solid #e2e8f0;
  border-radius: var(--r-md); font-size: var(--fs-sm); background: white;
}
.registry-filters button { background: var(--cth-deep-blue); color: white; border: none; cursor: pointer; }

/* Responsive */
@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -260px; z-index: 50; transition: left 0.3s; }
  .sidebar.open { left: 0; }
  .profile-grid { grid-template-columns: repeat(2, 1fr); }
  .sui-banner { flex-direction: column; text-align: center; }
}

@media (max-width: 640px) {
  .step-header { flex-direction: column; align-items: flex-start; }
  .tools-grid { grid-template-columns: 1fr; }
  .trust-row { flex-direction: column; align-items: center; }
  .founder-profile-card { flex-direction: column; text-align: center; }
  .profile-info { justify-content: center; }
  .sui-header { flex-direction: column; text-align: center; }
  .sui-bar-label { width: 100px; font-size: var(--fs-xs); }
  .form-row { grid-template-columns: 1fr; }
  .sui-registry-table { font-size: var(--fs-xs); }
  .auth-form .form-row { grid-template-columns: 1fr; }
}
