:root {
  --navy: #0b1f3a;
  --navy-2: #16365f;
  --yellow: #ffc928;
  --yellow-dark: #e4aa00;
  --white: #ffffff;
  --grey-50: #f7f9fc;
  --grey-100: #eef2f7;
  --grey-300: #ccd5e0;
  --grey-600: #637083;
  --grey-900: #172033;
  --green: #159b67;
  --red: #d9363e;
  --orange: #d97800;
  --shadow: 0 16px 45px rgba(11, 31, 58, 0.12);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: 'Inter', Arial, sans-serif; color: var(--grey-900); background: var(--white); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.narrow { max-width: 820px; }
.grow { flex: 1; }
.muted { color: var(--grey-600); }
.mt-32 { margin-top: 32px; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--grey-100); backdrop-filter: blur(12px); }
.nav-wrap { min-height: 72px; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.22rem; color: var(--navy); }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--yellow); }
.main-nav { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.main-nav a { font-weight: 600; font-size: .94rem; color: var(--navy-2); }
.main-nav a:hover { color: var(--yellow-dark); }
.nav-actions { display: flex; align-items: center; }
.user-chip { display: flex; align-items: center; gap: 10px; background: var(--grey-50); padding: 8px 12px; border-radius: 999px; font-size: .88rem; }
.menu-toggle { display: none; border: 0; background: transparent; font-size: 1.5rem; margin-left: auto; }
.link-button { border: 0; background: transparent; color: var(--navy-2); font-weight: 700; padding: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent; font-weight: 700; transition: .2s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--yellow); color: var(--navy); box-shadow: 0 8px 20px rgba(255,201,40,.25); }
.btn-primary:hover { background: #ffd452; }
.btn-secondary { background: var(--navy); color: var(--white); }
.btn-outline { border-color: var(--grey-300); background: var(--white); color: var(--navy); }
.btn-danger { background: var(--red); color: var(--white); }
.btn-small { min-height: 38px; padding: 0 14px; font-size: .85rem; }
.btn-block { width: 100%; margin-top: 14px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.hero { padding: 78px 0 64px; background: linear-gradient(135deg, #f9fbff 0%, #eef5ff 65%, #fff8dc 100%); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: 58px; }
.eyebrow { display: inline-block; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; color: var(--orange); font-size: .76rem; margin-bottom: 12px; }
h1 { font-size: clamp(2.4rem, 5vw, 4.6rem); line-height: 1.05; color: var(--navy); margin: 0 0 20px; letter-spacing: -.04em; }
h2 { font-size: clamp(1.8rem, 3vw, 2.7rem); line-height: 1.15; color: var(--navy); margin: 0 0 14px; letter-spacing: -.03em; }
h3 { color: var(--navy); margin-top: 0; }
.hero-copy { font-size: 1.12rem; max-width: 650px; color: var(--grey-600); }
.hero-actions, .button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.availability { display: flex; align-items: center; gap: 10px; margin-top: 24px; color: var(--navy-2); font-weight: 600; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 6px rgba(21,155,103,.13); }
.hero-card { background: var(--white); padding: 16px; border-radius: 26px; box-shadow: var(--shadow); transform: rotate(1deg); }
.mini-map { height: 340px; border-radius: 18px; background: #eaf2e4; position: relative; overflow: hidden; }
.map-road { position: absolute; background: rgba(255,255,255,.92); border: 2px solid #d7dfd2; }
.road-one { width: 120%; height: 32px; top: 45%; left: -10%; transform: rotate(-18deg); }
.road-two { width: 34px; height: 120%; top: -10%; left: 55%; transform: rotate(12deg); }
.pin { position: absolute; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50% 50% 50% 8px; transform: rotate(-45deg); background: var(--white); box-shadow: var(--shadow); font-size: 1.2rem; }
.pin > * { transform: rotate(45deg); }
.customer-pin { right: 16%; bottom: 16%; }
.electrician-pin { left: 24%; top: 20%; background: var(--yellow); }
.hero-card-content { display: flex; flex-direction: column; padding: 18px 6px 6px; }
.hero-card-content span { color: var(--grey-600); }

.section { padding: 76px 0; }
.section-alt { background: var(--grey-50); }
.section-heading { margin-bottom: 34px; max-width: 760px; }
.section-heading.centered { text-align: center; margin-inline: auto; }
.cards { display: grid; gap: 22px; }
.three-col { grid-template-columns: repeat(3, 1fr); }
.two-col { grid-template-columns: repeat(2, 1fr); }
.one-col { grid-template-columns: 1fr; }
.card, .form-card, .summary-card, .tracking-panel { background: var(--white); border: 1px solid var(--grey-100); border-radius: var(--radius); padding: 26px; box-shadow: 0 10px 28px rgba(11,31,58,.06); }
.card p { color: var(--grey-600); }
.step-number { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--yellow); color: var(--navy); font-weight: 800; margin-bottom: 18px; }
.level-badge, .status-pill { display: inline-flex; padding: 6px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; }
.level-1 { background: #e8f8f0; color: #10794f; }
.level-2 { background: #fff4cc; color: #875f00; }
.level-3 { background: #ffe5e7; color: #a42029; }
.icon-box { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 14px; background: var(--grey-50); font-size: 1.6rem; margin-bottom: 16px; }
.cta-section { padding: 28px 0 76px; }
.cta-box { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 34px; border-radius: 22px; background: var(--navy); color: var(--white); }
.cta-box h2 { color: var(--white); }
.cta-box p { margin-bottom: 0; color: #dce7f5; }

.page-hero { padding: 72px 0; background: linear-gradient(135deg, #f8fbff, #eef4ff); }
.page-hero.compact { padding: 54px 0; }
.page-hero h1 { font-size: clamp(2.2rem, 4vw, 3.5rem); }
.page-hero p { max-width: 720px; color: var(--grey-600); font-size: 1.05rem; }
.danger-hero { background: linear-gradient(135deg, #fff2f2, #fff8e8); }

.auth-section { min-height: 70vh; display: grid; place-items: center; padding: 72px 16px; background: var(--grey-50); }
.auth-card { width: min(520px, 100%); background: var(--white); padding: 34px; border-radius: 22px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 2.4rem; }
.demo-credentials { display: grid; gap: 5px; background: var(--grey-50); border: 1px dashed var(--grey-300); border-radius: 12px; padding: 14px; margin: 18px 0; font-size: .84rem; }
.form-switch { text-align: center; margin-top: 20px; }
.form-switch a { color: var(--navy-2); font-weight: 700; }

label { display: block; font-weight: 700; color: var(--navy); margin: 18px 0 7px; }
input, textarea, select { width: 100%; border: 1px solid var(--grey-300); border-radius: 11px; padding: 12px 14px; background: var(--white); color: var(--grey-900); outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--yellow-dark); box-shadow: 0 0 0 4px rgba(255,201,40,.18); }
.form-error { color: var(--red); display: block; margin-top: 5px; }
.form-grid { display: grid; gap: 16px; }
.form-grid.two-col { grid-template-columns: repeat(2, 1fr); }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
.summary-card { position: sticky; top: 96px; }
.clean-list { padding-left: 20px; color: var(--grey-600); }
.notice { background: var(--grey-50); border-left: 4px solid var(--yellow-dark); padding: 14px; margin-top: 18px; }
.assignment-preview { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 16px 0; }
.assignment-preview div, .details-grid div { background: var(--grey-50); border-radius: 12px; padding: 14px; }
.assignment-preview span, .details-grid span, .details-list span, .eta span, .eta-large span, .stat-card span { display: block; color: var(--grey-600); font-size: .82rem; }
.alert { border-radius: 12px; padding: 14px; margin: 14px 0; }
.alert-danger, .alert-error { background: #fff0f1; color: #a51f28; border: 1px solid #ffc9cd; }
.alert-warning { background: #fff8df; color: #7a5700; border: 1px solid #ffe294; }
.location-box { display: flex; justify-content: space-between; gap: 20px; align-items: center; background: var(--grey-50); padding: 16px; border-radius: 14px; margin: 18px 0; }
.location-box p { margin: 4px 0 0; color: var(--grey-600); font-size: .9rem; }
.checkbox-row { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; color: var(--grey-600); }
.checkbox-row input { width: auto; margin-top: 5px; }

.success-icon { width: 72px; height: 72px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 50%; background: #e7f8f0; color: var(--green); font-size: 2rem; font-weight: 800; }
.confirmation-card { padding: 30px; }
.details-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.assigned-electrician { display: flex; align-items: center; gap: 16px; border-top: 1px solid var(--grey-100); margin-top: 24px; padding-top: 24px; }
.assigned-electrician.compact-card { margin: 18px 0; padding: 18px 0; }
.avatar { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; background: var(--navy); color: var(--white); font-size: 1.35rem; font-weight: 800; }
.assigned-electrician h3, .assigned-electrician p { margin: 0; }
.eta { text-align: right; }
.eta strong { font-size: 1.5rem; color: var(--navy); }

.tracking-grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 24px; }
.tracking-map { min-height: 540px; border-radius: 22px; position: relative; overflow: hidden; background: linear-gradient(135deg, #deead9, #edf4e9); box-shadow: var(--shadow); }
.tracking-map .map-road { background: #fff; border: 5px solid #d0d8cc; }
.road-a { width: 120%; height: 44px; left: -10%; top: 50%; transform: rotate(-20deg); }
.road-b { width: 44px; height: 120%; left: 62%; top: -10%; transform: rotate(10deg); }
.road-c { width: 80%; height: 38px; left: -5%; top: 18%; transform: rotate(7deg); }
.tracking-pin { position: absolute; z-index: 5; display: flex; flex-direction: column; align-items: center; font-size: 1.8rem; transition: all .9s linear; }
.tracking-pin span { background: var(--navy); color: var(--white); font-size: .72rem; border-radius: 999px; padding: 5px 8px; white-space: nowrap; }
.home-marker { right: 7%; top: 22%; }
.moving-marker { left: 8%; top: 72%; }
.progress-line { position: absolute; left: 10%; bottom: 7%; width: 80%; height: 9px; background: rgba(255,255,255,.8); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--yellow); transition: width .5s linear; }
.map-label { position: absolute; left: 5%; bottom: 11%; background: rgba(255,255,255,.9); padding: 6px 10px; border-radius: 8px; font-size: .75rem; }
.status-pill { background: #eaf1ff; color: var(--navy-2); }
.eta-large { background: var(--navy); color: var(--white); padding: 20px; border-radius: 16px; margin: 18px 0; }
.eta-large span { color: #d7e2f0; }
.eta-large strong { display: block; font-size: 2.3rem; }
.details-list { display: grid; gap: 10px; margin-bottom: 14px; }
.details-list div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--grey-100); padding-bottom: 8px; }

.dashboard-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.dashboard-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { background: var(--white); border: 1px solid var(--grey-100); border-radius: 16px; padding: 20px; box-shadow: 0 8px 20px rgba(11,31,58,.05); }
.stat-card strong { display: block; color: var(--navy); font-size: 1.6rem; margin-top: 8px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--grey-100); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; background: var(--white); }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--grey-100); white-space: nowrap; }
th { background: var(--grey-50); color: var(--navy); font-size: .84rem; }
.empty-state { text-align: center; padding: 50px 20px; border: 1px dashed var(--grey-300); border-radius: 18px; background: var(--grey-50); }
.status-toggle { border: 0; border-radius: 999px; padding: 7px 11px; background: #ffe7e9; color: #9f2029; font-weight: 700; }
.status-toggle.active { background: #e6f7ef; color: #11794f; }
.contact-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 24px; }
.safety-card { border-left: 5px solid var(--yellow); }

.site-footer { background: var(--navy); color: #dbe6f2; padding: 52px 0 20px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr .7fr 1fr; gap: 34px; }
.footer-grid h4 { color: var(--white); }
.footer-grid a { display: block; margin: 8px 0; }
.footer-brand { color: var(--white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 32px; padding-top: 18px; font-size: .86rem; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; padding: 14px 18px; border-radius: 12px; color: var(--white); box-shadow: var(--shadow); }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }

@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 72px; left: 16px; right: 16px; padding: 18px; border-radius: 14px; background: var(--white); box-shadow: var(--shadow); flex-direction: column; align-items: stretch; }
  .main-nav.open { display: flex; }
  .nav-actions { margin-left: 0; }
  .hero-grid, .form-layout, .tracking-grid, .contact-grid { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr 1fr; }
  .dashboard-cards { grid-template-columns: 1fr 1fr; }
  .summary-card { position: static; }
  .details-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .nav-wrap { gap: 12px; }
  .nav-actions { display: none; }
  .hero { padding-top: 52px; }
  .hero-grid { gap: 36px; }
  .mini-map { height: 250px; }
  .section { padding: 56px 0; }
  .three-col, .two-col, .form-grid.two-col, .dashboard-cards, .details-grid, .assignment-preview { grid-template-columns: 1fr; }
  .cta-box, .location-box, .dashboard-toolbar, .assigned-electrician { align-items: flex-start; flex-direction: column; }
  .eta { text-align: left; }
  .tracking-map { min-height: 420px; }
  .auth-card { padding: 24px; }
}
