/* ============================================================
   AllStreet Homes — Shared Stylesheet
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: #fff; color: #1C2B1A; -webkit-font-smoothing: antialiased; overflow-x: hidden; }

:root {
  --green:      #2D6A4F;
  --green-mid:  #40916C;
  --green-lt:   #52B788;
  --green-pale: #D8F3DC;
  --sage:       #74C69D;
  --cream:      #F8F7F2;
  --navy:       #1C2B1A;
  --slate:      #3D5A47;
  --muted:      #6B7F6E;
  --muted-lt:   #9DB5A2;
  --border:     #E2EDE5;
  --red:        #DC2626;
  --red-pale:   #FEE2E2;
  --r:          10px;
  --r-lg:       18px;
}

/* ─── TYPOGRAPHY ─── */
.grad-text { background: linear-gradient(120deg, #2D6A4F 0%, #52B788 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
h1 { font-family: 'DM Serif Display', serif; line-height: 1.08; }
h2 { font-family: 'DM Serif Display', serif; font-size: clamp(1.9rem, 3.2vw, 2.8rem); line-height: 1.15; color: var(--navy); }
h3 { font-size: 1rem; font-weight: 700; color: var(--navy); }
p  { font-size: .9375rem; line-height: 1.78; color: var(--slate); }
p + p { margin-top: 14px; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 28px; }
section { padding: 96px 0; }
.eyebrow { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--green-mid); margin-bottom: 16px; }

/* ─── BUTTONS ─── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 13px 26px; border-radius: 50px; font-size: .9rem; font-weight: 600; text-decoration: none; border: none; cursor: pointer; transition: all .2s; }
.btn-primary { background: linear-gradient(120deg, #2D6A4F, #52B788); color: #fff; box-shadow: 0 4px 20px rgba(45,106,79,.25); }
.btn-primary:hover { box-shadow: 0 6px 30px rgba(45,106,79,.4); transform: translateY(-1px); }
.btn-white { background: #fff; color: var(--navy); font-weight: 700; }
.btn-white:hover { background: #F1F5F1; transform: translateY(-1px); }
.btn-outline-white { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.5); }
.btn-outline-white:hover { border-color: #fff; background: rgba(255,255,255,.1); }
.btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--border); border-radius: 50px; }
.btn-ghost:hover { border-color: var(--green-mid); color: var(--green); }
.btn-danger { background: linear-gradient(120deg, #DC2626, #EF4444); color: #fff; box-shadow: 0 4px 20px rgba(220,38,38,.25); }
.btn-danger:hover { box-shadow: 0 6px 30px rgba(220,38,38,.4); transform: translateY(-1px); }

/* ─── NAV ─── */
nav { position: fixed; top: 0; left: 0; right: 0; z-index: 200; transition: background .3s, border-color .3s, box-shadow .3s; }
nav.scrolled { background: rgba(255,255,255,.97); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); box-shadow: 0 2px 20px rgba(28,43,26,.06); }
.nav-inner { max-width: 1160px; margin: 0 auto; padding: 0 28px; height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

/* Logo */
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.logo-img { height: 32px; width: auto; filter: brightness(0) invert(1); transition: filter .3s; display: block; }
nav.scrolled .logo-img { filter: none; }
.logo-fallback { display: none; font-family: 'DM Serif Display', serif; font-size: 1.15rem; color: #fff; }
nav.scrolled .logo-fallback { color: var(--navy); }

/* Nav links */
.nav-links { display: flex; gap: 26px; list-style: none; }
.nav-links a { font-size: .875rem; font-weight: 500; text-decoration: none; transition: color .2s; color: rgba(255,255,255,.85); }
.nav-links a:hover { color: #fff; }
nav.scrolled .nav-links a { color: var(--muted); }
nav.scrolled .nav-links a:hover { color: var(--navy); }
.nav-right { display: flex; gap: 10px; align-items: center; }

/* Dropdown */
.nav-dropdown { position: relative; }
/* All nav links — consistent flex alignment so direct links and dropdown triggers sit at the same height */
.nav-links a { display: inline-flex; align-items: center; }
.nav-dropdown > a { gap: 4px; cursor: pointer; }
.nav-dropdown > a::after { content: '▾'; font-size: .65rem; opacity: .6; line-height: 1; }
/* Pad the top of the dropdown so the cursor doesn't pass through a gap — prevents menu disappearing on mouse travel */
.dropdown-menu { position: absolute; top: 100%; padding-top: 10px; left: 50%; transform: translateX(-50%); opacity: 0; visibility: hidden; transition: all .2s; pointer-events: none; }
.dropdown-menu-inner { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: 0 16px 40px rgba(28,43,26,.1); min-width: 180px; padding: 8px; }
.nav-dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; pointer-events: all; }
.dropdown-menu a { display: block; padding: 9px 14px; border-radius: 8px; font-size: .85rem; color: var(--slate) !important; text-decoration: none; transition: background .15s, color .15s !important; }
.dropdown-menu a:hover { background: var(--green-pale); color: var(--green) !important; }

/* Nav button overrides for scrolled */
nav.scrolled #navPortalBtn { border-color: var(--border); color: var(--slate); }
nav.scrolled #navPortalBtn:hover { border-color: var(--green-mid); color: var(--green); }

/* Hamburger */
.hamburger { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 40px; height: 40px; background: none; border: none; cursor: pointer; padding: 6px; flex-shrink: 0; }
.hamburger span { display: block; height: 2px; border-radius: 2px; background: #fff; transition: all .3s ease; }
nav.scrolled .hamburger span { background: var(--navy); }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu { display: none; position: fixed; inset: 0; top: 70px; z-index: 199; background: rgba(28,43,26,.97); backdrop-filter: blur(16px); flex-direction: column; padding: 32px 28px; gap: 8px; overflow-y: auto; }
.mobile-menu.open { display: flex; }
.mobile-menu a { font-size: 1.1rem; font-weight: 600; color: rgba(255,255,255,.85); text-decoration: none; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.07); transition: color .2s; }
.mobile-menu a:hover { color: #fff; }
.mobile-menu .mobile-ctas { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.mobile-menu .btn { justify-content: center; font-size: 1rem; padding: 15px; }

/* ─── PAGE HEADER (inner pages) ─── */
.page-header { background: var(--navy); padding: 120px 0 64px; position: relative; overflow: hidden; }
.page-header::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 70% 50%, rgba(82,183,136,.12) 0%, transparent 65%); pointer-events: none; }
.page-header-inner { position: relative; z-index: 1; }
.page-header h1 { font-size: clamp(2rem, 4vw, 3.2rem); color: #fff; margin-bottom: 14px; }
.page-header p { font-size: 1.05rem; color: rgba(255,255,255,.7); max-width: 540px; }
.page-header .eyebrow { color: var(--sage); }
.page-header-breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.page-header-breadcrumb a { font-size: .78rem; color: rgba(255,255,255,.45); text-decoration: none; }
.page-header-breadcrumb a:hover { color: var(--sage); }
.page-header-breadcrumb span { font-size: .78rem; color: rgba(255,255,255,.25); }

/* ─── FOOTER ─── */
footer { background: var(--navy); padding: 64px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 52px; }
.footer-brand p { font-size: .85rem; color: rgba(255,255,255,.4); max-width: 230px; line-height: 1.65; margin-top: 14px; }
.footer-logo-img { height: 28px; width: auto; filter: brightness(0) invert(1); display: block; }
.f-col h4 { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.3); margin-bottom: 14px; }
.f-col ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.f-col ul a { font-size: .85rem; color: rgba(255,255,255,.55); text-decoration: none; transition: color .15s; }
.f-col ul a:hover { color: var(--sage); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.07); padding-top: 28px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-bottom p { font-size: .78rem; color: rgba(255,255,255,.3); }
.footer-scam-link { font-size: .75rem; color: rgba(255,255,255,.35); }
.footer-scam-link a { color: var(--sage); text-decoration: none; }
.footer-scam-link a:hover { text-decoration: underline; }

/* ─── FORMS ─── */
.form-input { width: 100%; padding: 13px 16px; border: 1.5px solid var(--border); border-radius: var(--r); font-size: .9rem; font-family: 'Inter', sans-serif; color: var(--navy); background: #fff; transition: border-color .2s; outline: none; }
.form-input:focus { border-color: var(--green-mid); }
.form-input::placeholder { color: var(--muted-lt); }
textarea.form-input { resize: vertical; min-height: 110px; }
.form-row { display: flex; gap: 12px; }
.form-note { font-size: .75rem; color: var(--muted-lt); }
.success-msg { display: none; padding: 14px 18px; background: var(--green-pale); border: 1px solid var(--green-lt); border-radius: var(--r); color: var(--green); font-size: .88rem; font-weight: 600; }

/* ─── ANIMATIONS ─── */
.fade-up { opacity: 0; transform: translateY(28px); transition: opacity .65s ease, transform .65s ease; }
.fade-up.vis { opacity: 1; transform: none; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ─── SIDEBAR NAV (for policy/content pages) ─── */
.content-layout { display: grid; grid-template-columns: 240px 1fr; gap: 56px; align-items: start; }
.sidebar-nav { position: sticky; top: 90px; }
.sidebar-nav ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.sidebar-nav ul a { display: block; padding: 9px 14px; border-radius: 8px; font-size: .85rem; color: var(--muted); text-decoration: none; transition: all .15s; border-left: 2px solid transparent; }
.sidebar-nav ul a:hover { color: var(--green); background: var(--green-pale); border-left-color: var(--green-lt); }
.sidebar-nav ul a.active { color: var(--green); font-weight: 600; background: var(--green-pale); border-left-color: var(--green); }
.sidebar-nav-title { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-lt); padding: 0 14px; margin-bottom: 8px; }

/* ─── CONTENT SECTIONS ─── */
.content-section { padding: 32px 0; border-bottom: 1px solid var(--border); }
.content-section:last-child { border-bottom: none; }
.content-section h2 { font-size: 1.4rem; margin-bottom: 6px; color: var(--navy); }
.content-section .section-label { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--green-mid); margin-bottom: 10px; display: block; }
.content-section h3 { font-size: 1rem; font-weight: 700; color: var(--navy); margin: 20px 0 10px; }
.content-section p { font-size: .9rem; line-height: 1.75; color: var(--slate); }
.content-section ul { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.content-section ul li { font-size: .9rem; color: var(--slate); line-height: 1.6; padding-left: 20px; position: relative; }
.content-section ul li::before { content: '•'; position: absolute; left: 6px; color: var(--green-lt); font-weight: 700; }
.content-section ol { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.content-section ol li { font-size: .9rem; color: var(--slate); line-height: 1.6; }
.info-card { background: var(--cream); border: 1px solid var(--border); border-radius: var(--r); padding: 18px 20px; margin: 16px 0; }
.info-card p { font-size: .85rem; color: var(--muted); margin: 0; }
.warning-card { background: var(--red-pale); border: 1px solid #FECACA; border-radius: var(--r); padding: 18px 20px; margin: 16px 0; }
.warning-card p { font-size: .85rem; color: #991B1B; margin: 0; }
.fee-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.fee-table th { text-align: left; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--cream); padding: 10px 14px; border: 1px solid var(--border); }
.fee-table td { padding: 12px 14px; border: 1px solid var(--border); font-size: .88rem; color: var(--slate); vertical-align: top; }
.fee-table tr:hover td { background: var(--cream); }
.fee-amount { font-weight: 700; color: var(--navy); white-space: nowrap; }

/* ─── RESPONSIVE ─── */
@media(max-width:1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr !important; }
  .content-layout { grid-template-columns: 1fr; }
  .sidebar-nav { position: static; display: flex; flex-wrap: wrap; gap: 8px; }
  .sidebar-nav ul { flex-direction: row; flex-wrap: wrap; }
  .sidebar-nav ul a { border-left: none; border-bottom: 2px solid transparent; }
  .sidebar-nav ul a:hover, .sidebar-nav ul a.active { border-bottom-color: var(--green); border-left-color: transparent; }
  .sidebar-nav-title { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media(max-width:768px) {
  section { padding: 64px 0; }
  .hamburger { display: flex; }
  .nav-links { display: none !important; }
  .nav-right { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .form-row { flex-direction: column; }
  .page-header { padding: 100px 0 48px; }
}
@media(max-width:480px) {
  .container { padding: 0 18px; }
}
