/* HomeConnect — Base Styles */

:root {
  --navy:    #1B2A4A;
  --teal:    #0D7377;
  --orange:  #E8702A;
  --white:   #FFFFFF;
  --gray-50: #F8FAFC;
  --gray-100:#F1F5F9;
  --gray-200:#E2E8F0;
  --gray-300:#CBD5E1;
  --gray-500:#64748B;
  --gray-700:#334155;
  --gray-900:#0F172A;
  --green:   #16A34A;
  --red:     #DC2626;
  --shadow:  0 4px 24px rgba(0,0,0,.10);
  --radius:  8px;
  --max-w:   1140px;
}

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

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 16px; line-height: 1.6; color: var(--gray-900);
  background: var(--white); -webkit-font-smoothing: antialiased;
}
h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; line-height: 1.1; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 700; line-height: 1.2; }
h3 { font-size: 1.25rem; font-weight: 600; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4rem 0; }
.section--dark { background: var(--navy); color: var(--white); }
.section--gray { background: var(--gray-50); }
.text-center { text-align: center; }

/* Nav */
.nav {
  background: var(--white); border-bottom: 1px solid var(--gray-200);
  padding: 0 1.5rem; position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.nav-brand { font-size: 1.25rem; font-weight: 800; color: var(--navy); }
.nav-brand span { color: var(--teal); }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { color: var(--gray-700); text-decoration: none; font-weight: 500; }
.nav-links a:hover { color: var(--teal); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1.5rem; border-radius: var(--radius); font-weight: 600;
  font-size: 1rem; cursor: pointer; text-decoration: none; transition: all .2s;
  border: none; white-space: nowrap; line-height: 1;
}
.btn-primary { background: var(--orange); color: var(--white); }
.btn-primary:hover { background: #c95f1f; transform: translateY(-1px); }
.btn-secondary { background: var(--navy); color: var(--white); }
.btn-teal { background: var(--teal); color: var(--white); }
.btn-outline { border: 2px solid var(--navy); color: var(--navy); background: none; }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-lg { padding: 1rem 2rem; font-size: 1.125rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* Forms */
.form-group { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.25rem; }
.form-label { font-weight: 600; font-size: .9rem; color: var(--gray-700); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: .75rem 1rem; border: 2px solid var(--gray-200);
  border-radius: var(--radius); font-size: 1rem; font-family: inherit;
  background: var(--white); transition: border-color .2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,115,119,.12);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-error { color: var(--red); font-size: .85rem; font-weight: 500; }
.form-hint { color: var(--gray-500); font-size: .8rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #2d4a6b 100%);
  color: var(--white); padding: 5rem 0;
}
.hero-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.hero-content { }
.hero h1 { color: var(--white); margin-bottom: 1rem; }
.hero p { color: rgba(255,255,255,.8); font-size: 1.15rem; margin-bottom: 2rem; max-width: 52ch; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-eyebrow {
  font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--teal); margin-bottom: 1rem;
}
.hero-badge { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 100px; padding: .4rem 1rem; font-size: .85rem; display: inline-flex; align-items: center; gap: .5rem; }

/* Stats bar */
.stats-bar { background: var(--teal); padding: 2rem 0; }
.stats-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
.stat-item { text-align: center; }
.stat-number { font-size: 2.25rem; font-weight: 800; color: var(--white); }
.stat-label { color: rgba(255,255,255,.75); font-size: .875rem; }

/* Categories */
.categories { padding: 5rem 0; }
.categories h2 { margin-bottom: .5rem; }
.categories-sub { color: var(--gray-500); margin-bottom: 3rem; }
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.category-card {
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
  padding: 1.5rem 1rem; border: 2px solid var(--gray-200); border-radius: var(--radius);
  cursor: pointer; transition: all .2s; text-decoration: none; color: var(--gray-700);
}
.category-card:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(13,115,119,.12); }
.category-icon { font-size: 2rem; }
.category-label { font-weight: 600; font-size: .9rem; text-align: center; }

/* How it works */
.how-it-works { background: var(--gray-50); padding: 5rem 0; }
.how-it-works h2 { margin-bottom: 3rem; text-align: center; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; max-width: 960px; margin: 0 auto; }
.step { text-align: center; }
.step-icon { width: 64px; height: 64px; background: var(--teal); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin: 0 auto 1rem; }
.step-num { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--teal); margin-bottom: .5rem; }
.step h3 { margin-bottom: .5rem; }
.step p { color: var(--gray-500); font-size: .9rem; }

/* CTA section */
.cta-section { background: var(--navy); color: var(--white); padding: 5rem 0; text-align: center; }
.cta-section h2 { color: var(--white); margin-bottom: 1rem; }
.cta-section p { color: rgba(255,255,255,.7); margin-bottom: 2rem; }

/* Footer */
.footer { background: var(--gray-900); color: rgba(255,255,255,.7); padding: 3rem 0 1.5rem; }
.footer-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
.footer-brand { font-size: 1.25rem; font-weight: 800; color: var(--white); margin-bottom: .5rem; }
.footer-brand span { color: var(--teal); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-col h4 { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 1rem; opacity: .5; }
.footer-col a { display: block; color: rgba(255,255,255,.6); text-decoration: none; margin-bottom: .5rem; font-size: .875rem; }
.footer-col a:hover { color: var(--teal); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.5rem; font-size: .8rem; }

/* Lead Request Form */
.request-page { min-height: 100vh; display: flex; flex-direction: column; }
.request-header { background: var(--navy); color: var(--white); padding: 3rem 0; text-align: center; }
.request-header h1 { color: var(--white); font-size: 2.25rem; margin-bottom: .5rem; }
.request-header p { color: rgba(255,255,255,.7); }
.request-body { padding: 3rem 0; flex: 1; }
.request-form-card { background: var(--white); border-radius: 16px; padding: 2.5rem; box-shadow: 0 8px 32px rgba(0,0,0,.08); max-width: 640px; margin: 0 auto; }
.form-section-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--navy); border-bottom: 2px solid var(--gray-100); padding-bottom: .75rem; }
.select-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
.select-item {
  border: 2px solid var(--gray-200); border-radius: var(--radius); padding: .75rem .5rem;
  text-align: center; cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--gray-700);
  transition: all .2s; user-select: none;
}
.select-item input { display: none; }
.select-item:hover { border-color: var(--teal); }
.select-item.selected { border-color: var(--teal); background: rgba(13,115,119,.05); color: var(--teal); }

/* OTP Verification Page */
.verify-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--gray-50); }
.verify-card { background: var(--white); border-radius: 16px; padding: 2.5rem; box-shadow: 0 8px 32px rgba(0,0,0,.08); max-width: 440px; width: 100%; text-align: center; }
.verify-icon { font-size: 3rem; margin-bottom: 1rem; }
.verify-title { font-size: 1.5rem; font-weight: 700; margin-bottom: .5rem; }
.verify-desc { color: var(--gray-500); margin-bottom: 1.5rem; }
.otp-container { display: flex; gap: .75rem; justify-content: center; margin: 1.5rem 0; }
.otp-input {
  width: 52px; height: 60px; border: 2px solid var(--gray-200); border-radius: var(--radius);
  font-size: 1.5rem; font-weight: 700; text-align: center; transition: border-color .2s;
}
.otp-input:focus { outline: none; border-color: var(--teal); }
.resend-link { color: var(--gray-500); font-size: .875rem; }
.resend-link:hover { color: var(--teal); }

/* Confirmed page */
.confirmed-page { min-height: 80vh; display: flex; align-items: center; justify-content: center; }
.confirmed-box { text-align: center; max-width: 500px; }
.confirmed-check { font-size: 4rem; margin-bottom: 1rem; }

/* Contractor Auth pages */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-panel { padding: 4rem; display: flex; flex-direction: column; justify-content: center; }
.auth-left { background: var(--navy); color: var(--white); }
.auth-left h2 { color: var(--white); margin-bottom: 1rem; }
.auth-left p { color: rgba(255,255,255,.7); margin-bottom: 2rem; }
.auth-benefit { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; font-size: .9rem; }
.auth-benefit-icon { width: 36px; height: 36px; background: rgba(255,255,255,.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.auth-right h2 { margin-bottom: .5rem; }
.auth-right .auth-sub { color: var(--gray-500); margin-bottom: 2rem; }
.auth-form { max-width: 400px; }
.auth-divider { display: flex; align-items: center; gap: 1rem; color: var(--gray-400); font-size: .8rem; margin: 1.5rem 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: .875rem; color: var(--gray-500); }

/* Contractor Portal */
.portal-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.portal-sidebar { background: var(--navy); color: var(--white); padding: 1.5rem; }
.portal-logo { font-size: 1.25rem; font-weight: 800; margin-bottom: 2rem; display: flex; align-items: center; gap: .5rem; }
.portal-logo span { color: var(--teal); }
.portal-nav { display: flex; flex-direction: column; gap: .25rem; }
.portal-nav-link {
  display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem;
  border-radius: var(--radius); text-decoration: none; color: rgba(255,255,255,.65);
  font-size: .875rem; font-weight: 500; transition: all .15s;
}
.portal-nav-link:hover { background: rgba(255,255,255,.1); color: var(--white); }
.portal-nav-link.active { background: rgba(255,255,255,.15); color: var(--white); }
.portal-main { padding: 2rem; background: var(--gray-50); overflow-y: auto; }
.portal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.portal-page-title { font-size: 1.5rem; font-weight: 700; }
.portal-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2rem; }
.portal-stat-card { background: var(--white); border-radius: var(--radius); padding: 1.25rem; border: 1px solid var(--gray-100); }
.portal-stat-card .stat-label { color: var(--gray-500); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .25rem; }
.portal-stat-card .stat-value { font-size: 1.75rem; font-weight: 800; color: var(--navy); }

/* Lead card (contractor inbox) */
.lead-card {
  background: var(--white); border-radius: var(--radius); padding: 1.25rem;
  border: 1px solid var(--gray-100); margin-bottom: .75rem; transition: box-shadow .2s;
}
.lead-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.lead-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: .75rem; }
.lead-card-category { font-weight: 700; font-size: 1rem; }
.lead-card-time { color: var(--gray-500); font-size: .8rem; }
.lead-card-location { color: var(--gray-500); font-size: .875rem; margin-bottom: .75rem; display: flex; align-items: center; gap: .3rem; }
.lead-card-details { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: .75rem; }
.lead-card-detail { font-size: .85rem; color: var(--gray-700); }
.lead-card-detail strong { color: var(--gray-900); }
.lead-card-actions { display: flex; gap: .75rem; }

/* Status badge */
.badge {
  display: inline-flex; align-items: center; padding: .2rem .75rem;
  border-radius: 100px; font-size: .775rem; font-weight: 700;
}
.badge-new { background: #DCFCE7; color: #166534; }
.badge-contacted { background: #DBEAFE; color: #1E40AF; }
.badge-started { background: #FEF3C7; color: #92400E; }
.badge-hired { background: #F3E8FF; color: #6B21A8; }
.badge-complete { background: #F0FDF4; color: #15803D; }
.badge-pending { background: #F1F5F9; color: #475569; }

/* Notice banners */
.notice {
  display: flex; align-items: flex-start; gap: .75rem; padding: .75rem 1rem;
  border-radius: var(--radius); margin-bottom: 1rem; font-size: .875rem;
}
.notice-info { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.notice-success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.notice-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }

/* Job card */
.job-card { background: var(--white); border-radius: var(--radius); padding: 1.25rem; border: 1px solid var(--gray-100); margin-bottom: .75rem; }
.job-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: .75rem; }
.job-card-title { font-weight: 700; }
.job-card-value { font-size: 1.25rem; font-weight: 800; color: var(--navy); }
.job-card-actions { display: flex; gap: .75rem; margin-top: 1rem; }

/* Stripe callback */
.stripe-callback-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.stripe-callback-card { background: var(--white); border-radius: 16px; padding: 3rem; max-width: 480px; text-align: center; box-shadow: 0 8px 32px rgba(0,0,0,.08); }
.stripe-callback-icon { font-size: 3rem; margin-bottom: 1rem; }

/* Loading spinner */
.spinner {
  width: 24px; height: 24px; border: 3px solid var(--gray-200);
  border-top-color: var(--teal); border-radius: 50%;
  animation: spin .8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .portal-layout { grid-template-columns: 1fr; }
  .portal-sidebar { display: none; }
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
  .select-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .portal-stats { grid-template-columns: 1fr; }
}