/* ============================================================
   Tru Vantage — Portal Styles
   Design tokens inherited from landing page CSS.
   ============================================================ */

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

:root {
  --bg-dark:      #0C0C0F;
  --bg-card:      #16161A;
  --bg-accent:    #1E1E24;
  --text-primary: #F0EDE6;
  --text-secondary: #9B9BA4;
  --accent:       #F59E0B;
  --accent-light: #FBBF24;
  --accent-glow:  rgba(245, 158, 11, 0.15);
  --green:        #10B981;
  --coral:        #FF6B6B;
  --border:       rgba(240, 237, 230, 0.08);
  --radius:       12px;
  --radius-sm:    8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.2;
}

/* ---- Layout ---- */
.portal-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

.nav-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ---- Navigation ---- */
.portal-nav {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text-primary);
  text-decoration: none;
}
.logo span { color: var(--accent); }

.nav-link {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-link:hover { color: var(--text-primary); }

/* ---- Pill badges ---- */
.pill {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-glow);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent-light);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 999px;
  margin-bottom: 16px;
}
.pill-success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34D399;
}

/* ---- Hero section ---- */
.hero-section {
  text-align: center;
  padding: 56px 0 40px;
}
.hero-section h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 auto;
}

/* ---- Form card ---- */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  margin-bottom: 32px;
}

.form-error {
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.3);
  color: #FF8A8A;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.9rem;
}

/* ---- Form fields ---- */
.audit-form { display: flex; flex-direction: column; gap: 24px; }

.field { display: flex; flex-direction: column; gap: 8px; }

.field label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.field input,
.field textarea {
  background: var(--bg-accent);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  padding: 12px 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  resize: vertical;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-secondary); }

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ---- Primary button ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #0C0C0F;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.25);
  width: 100%;
}
.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 32px rgba(245, 158, 11, 0.35);
}
.btn-primary:active { transform: translateY(0); }

.form-footer {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: -8px;
}

/* ---- Trust row ---- */
.trust-row {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 0 0 48px;
  flex-wrap: wrap;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.trust-item svg { color: var(--accent); }

/* ---- Pending / loading state ---- */
.pending-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  gap: 20px;
}
.pending-state h2 { font-size: 1.6rem; }
.pending-state p { color: var(--text-secondary); max-width: 360px; }

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 107, 107, 0.15);
  border: 2px solid rgba(255, 107, 107, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: #FF8A8A;
  font-family: 'Space Grotesk', sans-serif;
}

/* ---- Results page ---- */
.results-header {
  text-align: center;
  padding: 56px 0 40px;
}
.results-header h1 {
  font-size: clamp(2rem, 5vw, 2.5rem);
  margin: 12px 0;
}

.email-confirmation {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34D399;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.email-confirmation svg { flex-shrink: 0; }
.results-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.results-sub em {
  color: var(--text-primary);
  font-style: normal;
}

/* ---- Tools grid ---- */
.tools-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 48px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tool-card:hover {
  border-color: rgba(245, 158, 11, 0.25);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.tool-rank {
  flex-shrink: 0;
  width: 52px;
  background: var(--bg-accent);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  border-right: 1px solid var(--border);
}

.tool-body { padding: 20px 24px; flex: 1; }

.tool-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.tool-emoji { font-size: 1.6rem; line-height: 1; }

.tool-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.tool-category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.tool-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.tool-why {
  background: var(--bg-accent);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-left: 2px solid var(--accent);
}
.why-label {
  display: block;
  font-weight: 600;
  color: var(--accent-light);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

/* ---- Results CTA ---- */
.results-cta {
  text-align: center;
  padding-bottom: 64px;
}
.cta-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.cta-sub {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.results-cta .btn-primary { max-width: 320px; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .form-card { padding: 24px 20px; }
  .trust-row { gap: 16px; }
  .tool-rank { width: 40px; font-size: 0.9rem; }
  .tool-body { padding: 16px; }
  .results-header h1 { font-size: 1.75rem; }
}