/* =====================================================
   MyAgreement – Main Stylesheet
   ===================================================== */

:root {
  --brand-primary: #0d6efd;
  --brand-dark: #1a1a2e;
  --transition: all .25s ease;
}

html { font-size: 15px; scroll-behavior: smooth; }
@media (min-width: 768px) { html { font-size: 16px; } }

body { margin-bottom: 0; font-family: 'Segoe UI', system-ui, sans-serif; color: #212529; }

/* ---- Focus rings ---- */
.btn:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(13,110,253,.25);
}

/* ---- Navbar ---- */
.navbar { transition: var(--transition); }
.navbar-brand { font-size: 1.3rem; letter-spacing: -.3px; }
.nav-link { font-weight: 500; transition: color .2s; }
.nav-link:hover { color: var(--brand-primary) !important; }

/* ---- Mobile collapse menu — dark steel panel ---- */
@media (max-width: 991.98px) {
  .navbar-mobile-menu.show,
  .navbar-mobile-menu.collapsing {
    background: #2b3244;
    border-radius: 0 0 14px 14px;
    padding: .25rem 1rem 1.25rem;
    margin: 0 -12px;          /* bleed to container edges */
    box-shadow: 0 10px 28px rgba(0,0,0,.22);
  }

  /* Nav links inside collapse */
  .navbar-mobile-menu .nav-mobile-link {
    color: rgba(255,255,255,.88) !important;
    padding: .7rem .5rem;
    border-radius: .5rem;
    display: flex;
    align-items: center;
    gap: .65rem;
    font-size: .95rem;
    transition: background .18s;
  }
  .navbar-mobile-menu .nav-mobile-link:hover,
  .navbar-mobile-menu .nav-mobile-link:focus {
    background: rgba(255,255,255,.1);
    color: #fff !important;
  }

  /* Icons inside mobile links */
  .nav-mobile-icon {
    font-size: 1rem;
    color: #6ea8fe;   /* soft blue accent */
    flex-shrink: 0;
  }

  /* Divider between nav links and auth button */
  .navbar-mobile-menu .navbar-nav + .navbar-nav {
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: .75rem;
    margin-top: .25rem;
  }

  /* Auth button inside collapse */
  .nav-auth-btn {
    width: 100%;
    justify-content: center;
    padding: .6rem 1rem;
    font-size: .9rem;
  }
}

/* Desktop: icons hidden (text-only links) */
@media (min-width: 992px) {
  .nav-mobile-icon { display: none; }
}

/* ---- Hero ---- */
.hero-section { background: linear-gradient(160deg, #f0f7ff 0%, #ffffff 60%); padding-top: 3rem; }
.hero-icon-area { position: relative; width: 360px; height: 360px; }
.hero-bg-icon { font-size: 18rem; opacity: .08; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.hero-badge {
  position: absolute;
  background: #fff;
  border-radius: 50px;
  padding: .5rem 1rem;
  font-size: .82rem;
  font-weight: 600;
  border: 1px solid #e9ecef;
  white-space: nowrap;
}
.hb-1 { top: 10%; right: -10%; }
.hb-2 { top: 50%; left: -15%; transform: translateY(-50%); }
.hb-3 { bottom: 10%; right: -5%; }

/* ---- Step Cards (legacy – kept for agreement step pages) ---- */
.step-card { transition: transform .2s, box-shadow .2s; }
.step-card:hover { transform: translateY(-4px); box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.1) !important; }
.step-num {
  width: 36px; height: 36px;
  background: var(--brand-primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
  flex-shrink: 0;
}
.step-num--sm { width: 28px; height: 28px; font-size: .8rem; }

/* ============================================================
   HOW IT WORKS — timeline layout
   ============================================================ */
.hiw-section {
  background: linear-gradient(180deg, #f8faff 0%, #ffffff 100%);
  padding-top: 0.75rem !important;
  padding-bottom: 1.5rem !important;
}

/* Slightly smaller heading */
.hiw-section .display-6 {
  font-size: 1.85rem;
}

/* Tighter gap between h2 and subtitle paragraph */
.hiw-section .text-center h2 {
  margin-bottom: .2rem;
}

/* Timeline row */
.hiw-timeline {
  display: flex;
  flex-direction: row;
  align-items: stretch;   /* all cards same height */
  gap: 0;
}

/* Each item: card + arrow side by side */
.hiw-item {
  display: flex;
  flex-direction: row;
  align-items: center;    /* arrow vertically centered on card */
  flex: 1 1 0;            /* equal width for every item */
  min-width: 0;
}

/* Arrow between cards */
.hiw-arrow {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  z-index: 2;
}
.hiw-arrow svg { width: 100%; height: 100%; overflow: visible; }

/* Card — uniform 2px border on ALL four sides */
.hiw-card {
  flex: 1 1 0;
  border: 2px solid var(--step-color);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0,0,0,.07);
  transition: transform .22s, box-shadow .25s;
  display: flex;
  flex-direction: column;
  align-self: stretch;    /* stretch to row height without needing height:100% */
}
.hiw-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 32px rgba(0,0,0,.14);
}

.hiw-card-body {
  padding: 1.5rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  position: relative;     /* for badge positioning */
}

/* Step number badge — larger & bolder */
.hiw-badge {
  position: absolute;
  top: 10px;
  left: 10px;
}
.hiw-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--step-color);
  color: #fff;
  font-weight: 900;
  font-size: 1rem;
  box-shadow: 0 3px 8px rgba(0,0,0,.22);
  letter-spacing: 0;
}

/* Icon circle */
.hiw-icon-wrap {
  width: 62px; height: 62px;
  border-radius: 50%;
  background: var(--step-bg);
  border: 2px solid var(--step-color);
  display: flex; align-items: center; justify-content: center;
  margin-top: .6rem;
  margin-bottom: .1rem;
  flex-shrink: 0;
}
.hiw-icon-wrap .bi {
  font-size: 1.6rem;
  color: var(--step-color);
}

/* Hint row pinned to bottom of card */
.hiw-hint {
  margin-top: auto;
  padding-top: .65rem;
  border-top: 1px dashed #dee2e6;
  width: 100%;
  font-size: .76rem;
  color: #6c757d;
  line-height: 1.45;
}
/* Larger hint text for steps 1 & 2 */
.hiw-hint--lg {
  font-size: .88rem;
  line-height: 1.55;
}

/* ---- TABLET (md) — 2-3 per row, arrows hidden, use grid gap ---- */
@media (max-width: 1199.98px) {
  .hiw-arrow { width: 28px; height: 28px; }
}

/* ---- MOBILE: stack vertically ---- */
@media (max-width: 767.98px) {
  .hiw-timeline {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }
  .hiw-item {
    flex-direction: column;
    align-items: center;
    width: 92%;           /* narrower than container — creates visible side padding */
    max-width: 400px;     /* reduced from 440px */
    flex: none;
  }
  /* Card: reset height so it grows with content */
  .hiw-card {
    width: 100%;
    height: auto !important;
    flex: none;
  }
  .hiw-card-body {
    padding: 1.25rem 1.5rem 1rem;   /* slightly reduced for compact mobile look */
    flex: none;
  }
  /* Arrow rotated to point down */
  .hiw-arrow {
    width: 22px;
    height: 24px;
    flex-shrink: 0;
    margin: 2px 0;
  }
  .hiw-arrow svg { transform: rotate(90deg); }
}

/* ---- Step Progress ---- */
.step-progress { position: relative; }
.step-circle {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #e9ecef;
  color: #6c757d;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; margin: 0 auto;
  font-size: 1rem;
}
.step-circle.active { background: var(--brand-primary); color: #fff; box-shadow: 0 0 0 4px #0d6efd33; }
.step-circle.done { background: #198754; color: #fff; }
.step-label { font-size: .75rem; }
.step-connector {
  height: 2px;
  background: #dee2e6;
  flex: 1;
  margin-top: -22px;
  position: relative;
  z-index: 0;
}
.step-connector.done { background: #198754; }

/* ---- Hover Lift ---- */
.hover-lift { transition: transform .2s, box-shadow .2s; }
.hover-lift:hover { transform: translateY(-4px); box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.1) !important; }

/* ---- Agreement Draft Preview ---- */
.draft-preview { font-size: .9rem; line-height: 1.8; }
.draft-preview h2, .draft-preview h5 { color: #1a1a2e; }

/* ---- Content Area ---- */
.content-area h2, .content-area h3 { color: #1a1a2e; margin-top: 1.5rem; }
.content-area ul, .content-area ol { padding-left: 1.5rem; }
.content-area li { margin-bottom: .4rem; }

/* ---- Landing Page typography ---- */
/* H1: controlled size — not display-class large, standard SEO heading */
.landing-h1 { font-size: 1.35rem; line-height: 1.3; }
@media (min-width: 768px) { .landing-h1 { font-size: 1.55rem; } }

/* H2/H3 inside DB-rendered page content — consistent, not too large */
.landing-content h2 { font-size: 1.1rem; font-weight: 700; color: #1a1a2e; margin-top: 1.75rem; margin-bottom: .6rem; }
.landing-content h3 { font-size: .95rem; font-weight: 600; color: #1a1a2e; margin-top: 1.25rem; margin-bottom: .4rem; }

/* FAQ section heading */
.landing-h2 { font-size: 1.2rem; }
@media (min-width: 768px) { .landing-h2 { font-size: 1.35rem; } }

/* FAQ accordion tweaks */
.accordion-button { font-size: .95rem; }
.accordion-body { font-size: .9rem; line-height: 1.7; }

/* ---- HowItWorks CTA buttons — smaller on mobile ---- */
@media (max-width: 767.98px) {
  .hiw-section .btn-lg {
    font-size: .85rem;
    padding: .55rem 1.1rem;
  }
}

/* ---- Forms ---- */
.form-control, .form-select { border-radius: .5rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand-primary); }

/* ---- Buttons ---- */
.btn { border-radius: .5rem; font-weight: 500; }
.btn-lg { padding: .75rem 1.75rem; }

/* ---- Footer ---- */
footer a:hover { color: #fff !important; }
.footer-text { color: #ced4da !important; }
.footer-link { color: #adb5bd !important; }
.footer-link:hover { color: #fff !important; }

/* ---- Utilities ---- */
.bg-primary-subtle { background-color: #e8f0fe !important; }
.text-primary { color: var(--brand-primary) !important; }
.min-vh-60 { min-height: 60vh; }