/* ============================================================
   Tru Vantage — Portal Styles
   Branded for truvntage.com: dark professional + amber/gold accent.
   ============================================================ */

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

:root {
  /* Brand palette — truvntage.com aesthetic */
  --bg-dark:        #08080A;
  --bg-card:        #111115;
  --bg-elevated:    #1A1A1F;
  --text-primary:   #F4EFE8;
  --text-muted:     #9896A0;
  --accent:         #D4880A;
  --accent-hover:   #E89B1A;
  --accent-dim:     rgba(212, 136, 10, 0.18);
  --accent-border:  rgba(212, 136, 10, 0.35);
  --brand-red:     #D42020;
  --text-white:    #FFFFFF;
  --border:         rgba(244, 239, 232, 0.07);
  --border-hover:   rgba(244, 239, 232, 0.14);
  --success:        #22C55E;
  --success-dim:    rgba(34, 197, 94, 0.12);
  --error:          #F87171;
  --error-dim:      rgba(248, 113, 113, 0.12);
  --radius:         14px;
  --radius-sm:      8px;
  --radius-xs:      6px;
  --shadow-card:    0 4px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow:    0 0 40px rgba(212, 136, 10, 0.18);
  --transition:     0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: 'Space Grotesk', 'DM Sans', sans-serif;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

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

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

/* ---- Navigation ---- */
.portal-nav {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-dark);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

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

/* Image logo in nav */
.nav-logo {
  display: flex;
  align-items: center;
  height: 44px;
}
.nav-logo img {
  height: 44px;
  width: auto;
  object-fit: contain;
  border-radius: var(--radius-xs);
}

/* Text fallback logo (hidden when image is present) */
.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.03em;
}
.logo span { color: var(--accent); }

.nav-link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
  padding: 6px 0;
}
.nav-link:hover { color: var(--text-primary); }

/* ---- Pill badges ---- */
.pill {
  display: inline-block;
  padding: 5px 14px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  color: var(--accent-hover);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  margin-bottom: 18px;
}
.pill-success {
  background: var(--success-dim);
  border-color: rgba(34, 197, 94, 0.3);
  color: var(--success);
}

/* ---- Hero section ---- */
.hero-section {
  text-align: center;
  padding: 60px 0 44px;
}
.hero-section h1 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 14px;
  background: linear-gradient(160deg, var(--text-primary) 40%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  color: var(--text-muted);
  font-size: 1.02rem;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.65;
}

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

.form-error {
  background: var(--error-dim);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: var(--error);
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.9rem;
}

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

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

.field label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.field input,
.field textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  padding: 13px 16px;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
  resize: vertical;
  width: 100%;
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-muted);
}
.field input:hover,
.field textarea:hover {
  border-color: var(--border-hover);
}
.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: var(--bg-card);
}
.field textarea { min-height: 110px; }

.field-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---- Primary CTA button ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, #B87808 100%);
  color: #08080A;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  padding: 15px 28px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  box-shadow: 0 0 28px rgba(212, 136, 10, 0.22), 0 2px 8px rgba(0,0,0,0.3);
  width: 100%;
  letter-spacing: 0.01em;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 36px rgba(212, 136, 10, 0.32), 0 2px 8px rgba(0,0,0,0.3);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 0 20px rgba(212, 136, 10, 0.18);
}
.btn-primary svg { flex-shrink: 0; transition: transform var(--transition); }
.btn-primary:hover svg { transform: translateX(2px); }

/* Small pill button variant */
.btn-primary.btn-sm {
  width: auto;
  padding: 10px 22px;
  font-size: 0.9rem;
}

.form-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: -6px;
}

/* ---- Trust row ---- */
.trust-row {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 0 0 52px;
  flex-wrap: wrap;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.83rem;
  color: var(--text-muted);
  font-weight: 500;
}
.trust-item svg { color: var(--accent); flex-shrink: 0; }

/* ---- Pending / loading state ---- */
.pending-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 88px 24px;
  gap: 18px;
}
.pending-state h2 { font-size: 1.55rem; }
.pending-state p { color: var(--text-muted); max-width: 360px; line-height: 1.65; }

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

.error-icon {
  width: 50px;
  height: 50px;
  background: var(--error-dim);
  border: 2px solid rgba(248, 113, 113, 0.35);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--error);
  font-family: 'Space Grotesk', sans-serif;
}

/* ---- Results page ---- */
.results-header {
  text-align: center;
  padding: 60px 0 44px;
}
.results-header h1 {
  font-size: clamp(1.9rem, 5vw, 2.4rem);
  margin: 12px 0;
}

.email-confirmation {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--success-dim);
  border: 1px solid rgba(34, 197, 94, 0.28);
  color: var(--success);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.email-confirmation svg { flex-shrink: 0; }
.results-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}
.results-sub strong { color: var(--text-primary); font-weight: 600; }
.results-sub em {
  color: var(--text-primary);
  font-style: normal;
  font-weight: 500;
}

/* ---- Tools grid ---- */
.tools-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  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 var(--transition), box-shadow var(--transition);
}
.tool-card:hover {
  border-color: rgba(212, 136, 10, 0.25);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.35);
}

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

.tool-body { padding: 22px 26px; flex: 1; }

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

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

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

.tool-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
}

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

.tool-why {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.55;
  border-left: 2px solid var(--accent);
}
.why-label {
  display: block;
  font-weight: 700;
  color: var(--accent-hover);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

/* ---- Results CTA ---- */
.results-cta {
  text-align: center;
  padding-bottom: 72px;
}
.cta-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.18rem;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.cta-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 22px;
}
.results-cta .btn-primary { max-width: 320px; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .portal-nav { padding: 14px 0; }
  .form-card { padding: 26px 20px; }
  .trust-row { gap: 16px; }
  .tool-rank { width: 42px; font-size: 0.9rem; }
  .tool-body { padding: 16px; }
  .results-header h1 { font-size: 1.7rem; }
  .hero-section { padding: 44px 0 32px; }
  .results-cta { padding-bottom: 56px; }
}

/* ---- Focus visible ---- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Red title text ---- */
.title-red {
  color: var(--brand-red) !important;
  -webkit-text-fill-color: var(--brand-red) !important;
  background: none !important;
}

/* ---- White title text ---- */
.title-white {
  color: var(--text-white) !important;
  -webkit-text-fill-color: var(--text-white) !important;
  background: none !important;
}

/* ---- Footer logo ---- */
.portal-footer {
  padding: 28px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.footer-logo img {
  height: 36px;
  width: auto;
  object-fit: contain;
  border-radius: var(--radius-xs);
  opacity: 0.65;
  transition: opacity var(--transition);
}
.footer-logo img:hover { opacity: 1; }

/* ---- CTA area logo ---- */
.cta-logo {
  display: inline-flex;
  align-items: center;
  margin-bottom: 14px;
}
.cta-logo img {
  height: 30px;
  width: auto;
  object-fit: contain;
  border-radius: var(--radius-xs);
}