/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@font-face {
  font-family: 'Clarendon';
  src: local('Clarendon'), local('Clarendon-Regular');
  font-weight: 400;
  font-style: normal;
}

:root {
  --red: #EC1B34;
  --red-hover: #d01129;
  --black: #000000;
  --dark-bg: #0a0a0a;
  --white: #ffffff;
  --light-gray: #e0e0e0;
  --card-bg: rgba(20, 20, 20, 0.85);
  --border-blue: #84C4F5;
  --border-green: #13BD79;
  --border-orange: #FF7340;
  --font-body: 'Cabinet Grotesk', 'Segoe UI', Georgia, sans-serif;
  --font-heading: 'Clarendon', Georgia, serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--black);
  color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }

/* ===== NAVBAR ===== */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  background: var(--black);
  border-bottom: 1px solid rgba(236, 27, 52, 0.3);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-logo img {
  height: 42px;
  width: auto;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.navbar-links a {
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.navbar-links a:hover { color: var(--red); }

.navbar-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.3);
}

.btn-red {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--red);
  color: var(--white);
  padding: 0.65rem 1.5rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-red:hover { background: var(--red-hover); transform: translateY(-1px); }
.btn-red:active { transform: translateY(0); }

.btn-red .btn-icon {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
}

/* Mobile hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: 0.3s;
}

/* ===== HERO SECTION (for signup/refer/preferences) ===== */
.hero-section {
  position: relative;
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 700px;
  width: 100%;
}

.hero-content h1 {
  font-family: var(--font-heading);
  font-size: 3.2rem;
  font-weight: 400;
  margin-bottom: 1rem;
  line-height: 1.15;
}

.hero-content .subtitle {
  font-size: 0.95rem;
  color: var(--light-gray);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-content .subtitle strong {
  color: var(--white);
  font-weight: 600;
}

/* ===== FORM STYLES ===== */
.form-wrapper {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
}

.form-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.form-row.full { flex-direction: column; }

.form-input {
  flex: 1;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  font-size: 0.9rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s;
}

.form-input::placeholder { color: #777; }
.form-input:focus { border-color: var(--red); }

.form-section {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  color: #333;
}

.form-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.75rem;
  color: #333;
}

.radio-group {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: #333;
}

.radio-group input[type="radio"] {
  accent-color: var(--red);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
  accent-color: var(--red);
  width: 16px;
  height: 16px;
  margin-top: 2px;
  cursor: pointer;
}

.checkbox-group label {
  font-size: 0.82rem;
  color: #555;
  cursor: pointer;
}

.form-submit {
  text-align: center;
  margin-top: 1.25rem;
}

/* Success message */
.success-message {
  display: none;
  background: rgba(19, 189, 121, 0.15);
  border: 1px solid var(--border-green);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  margin-top: 1rem;
}

.success-message h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.success-message p {
  font-size: 0.9rem;
  color: var(--light-gray);
  line-height: 1.7;
}

.success-message.show { display: block; }

/* Error message */
.error-message {
  display: none;
  color: var(--red);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 0.75rem;
}

/* ===== METRICS PAGE ===== */
.metrics-layout {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - 60px);
}

.metrics-sidebar {
  position: sticky;
  top: 60px;
  width: 300px;
  min-width: 300px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  background: var(--dark-bg);
  padding: 1rem 0;
  border-right: 1px solid rgba(236, 27, 52, 0.2);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.metrics-sidebar::-webkit-scrollbar { display: none; }

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--white);
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}

.sidebar-nav-item:hover { background: rgba(255, 255, 255, 0.05); }

.sidebar-nav-item.active {
  background: var(--black);
  border-left: 3px solid var(--red);
  border-radius: 0 0.75rem 0.75rem 0;
  position: relative;
}

.sidebar-nav-item .nav-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-nav-item .nav-label {
  color: var(--white);
  font-weight: 600;
  font-size: 0.82rem;
}

.metrics-content {
  flex: 1;
  padding: 2.5rem 3rem;
  min-width: 0;
}

.metrics-content h1 {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 400;
  margin-bottom: 2.5rem;
  line-height: 1.2;
}

/* Mobile sidebar nav (top horizontal) */
.metrics-mobile-nav {
  display: none;
  overflow-x: auto;
  white-space: nowrap;
  padding: 0.75rem 1rem;
  background: var(--dark-bg);
  border-bottom: 1px solid rgba(236, 27, 52, 0.2);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.metrics-mobile-nav::-webkit-scrollbar { display: none; }

.metrics-mobile-nav a {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  color: var(--white);
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  margin-right: 0.5rem;
  transition: background 0.2s;
}
.metrics-mobile-nav a:hover,
.metrics-mobile-nav a.active {
  background: var(--red);
  color: var(--white);
}

/* Metric Card */
.metric-card {
  display: none;
}

.metric-card.active { display: block; }

.metric-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.metric-header .metric-icon { font-size: 2rem; }

.metric-header h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 400;
}

.metric-description {
  font-size: 0.92rem;
  color: var(--light-gray);
  line-height: 1.8;
  margin-bottom: 1.5rem;
  max-width: 850px;
}

.metric-cards-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.results-card, .formula-card {
  flex: 1;
  min-width: 280px;
  border-radius: 1.25rem;
  padding: 1.5rem;
  background: var(--black);
}

.results-card {
  border: 1px solid;
  border-image: linear-gradient(to bottom, var(--card-border-color, #84C4F5) 0%, var(--card-border-color, #84C4F5) 57%, transparent 100%) 1;
  border-radius: 1.25rem;
  background: var(--black);
  position: relative;
  overflow: hidden;
}

/* Use a pseudo-element approach for rounded gradient borders */
.results-card, .formula-card {
  position: relative;
  border: none;
  background: var(--black);
  border-radius: 1.25rem;
  overflow: hidden;
}

.results-card::before, .formula-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 1.25rem;
  padding: 1px;
  background: linear-gradient(to bottom, var(--card-border-color, #84C4F5) 0%, var(--card-border-color, #84C4F5) 57%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.card-header-icon { font-size: 1.3rem; }

.card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  font-style: italic;
}

.result-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--light-gray);
  line-height: 1.6;
}

.result-item .diamond {
  color: var(--red);
  margin-top: 2px;
  flex-shrink: 0;
}

.formula-text {
  font-size: 0.9rem;
  color: var(--light-gray);
  line-height: 1.7;
}

/* CTA line */
.metric-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.metric-cta-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3));
}

/* Color classes */
.border-blue { --card-border-color: #84C4F5; }
.border-green { --card-border-color: #13BD79; }
.border-orange { --card-border-color: #FF7340; }

/* ===== FOOTER AREA ===== */
.page-footer {
  background: var(--black);
  padding: 2rem;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: auto;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
  .metrics-sidebar { display: none; }
  .metrics-mobile-nav { display: block; }
  .metrics-content { padding: 1.5rem; }
  .metrics-content h1 { font-size: 2rem; }
}

@media (max-width: 768px) {
  .navbar-links { display: none; }
  .hamburger { display: flex; }

  .navbar-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--black);
    padding: 1.5rem;
    border-bottom: 1px solid rgba(236, 27, 52, 0.3);
    gap: 1rem;
  }

  .navbar-divider { display: none; }

  .hero-content h1 { font-size: 2.2rem; }
  .form-row { flex-direction: column; }
  .metric-cards-row { flex-direction: column; }
  .metric-header h2 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .hero-content h1 { font-size: 1.8rem; }
  .metrics-content h1 { font-size: 1.6rem; }
  .navbar { padding: 0.75rem 1rem; }
}
