/* ==========================================================================
   Abel Web Designs — site + portal stylesheet
   ========================================================================== */

:root {
  --ink: #0b1020;
  --ink-2: #131a33;
  --ink-3: #1d2647;
  --brand: #2448d8;
  --brand-600: #1c3bb8;
  --brand-50: #eef2ff;
  --brand-100: #dfe6ff;
  --accent: #f2a93b;
  --text: #1b2033;
  --muted: #5d6582;
  --subtle: #8a91aa;
  --line: #e4e7f0;
  --line-2: #eef0f6;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --green: #12805c;   --green-bg: #e5f6ef;
  --amber: #a15c00;   --amber-bg: #fdf1dc;
  --red: #c0352b;     --red-bg: #fde9e7;
  --violet: #6740c8;  --violet-bg: #efe9fd;
  --blue: #1f50c9;    --blue-bg: #e7eeff;
  --gray: #59607a;    --gray-bg: #eef0f5;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 56, .06);
  --shadow: 0 1px 2px rgba(16, 24, 56, .05), 0 8px 24px -12px rgba(16, 24, 56, .14);
  --shadow-lg: 0 30px 60px -24px rgba(11, 16, 32, .45);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--text);
  background: var(--surface); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }
h1, h2, h3, h4, h5 { margin: 0 0 .5em; line-height: 1.15; letter-spacing: -.02em; color: var(--ink); font-weight: 800; }
p { margin: 0 0 1em; }
em.serif, .serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
::selection { background: var(--brand-100); }
:focus-visible { outline: 3px solid rgba(36, 72, 216, .35); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 14px; z-index: 100; border-radius: 8px; }
.skip-link:focus { left: 8px; }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 15px/1 var(--font); padding: 13px 20px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s;
  white-space: nowrap; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 6px 16px -6px rgba(36,72,216,.6); }
.btn-primary:hover { background: var(--brand-600); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-3); color: #fff; }
.btn-light { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-light:hover { border-color: #cdd2e1; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg); color: var(--ink); }
.btn-ghost-light { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.18); }
.btn-ghost-light:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #0d6a4b; color: #fff; }
.btn-danger { background: #fff; color: var(--red); border-color: #f2c7c2; }
.btn-danger:hover { background: var(--red-bg); color: var(--red); }
.btn-sm { padding: 8px 13px; font-size: 13.5px; border-radius: 8px; }
.btn-lg { padding: 16px 26px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; }

/* ---------------------------------------------------------------- Public header */
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(11, 16, 32, .86);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.site-header .container { display: flex; align-items: center; gap: 28px; height: 70px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: #fff; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.brand:hover { color: #fff; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #8d97bb; margin-top: 1px; }
.main-nav { display: flex; gap: 4px; margin-left: auto; }
.main-nav a { color: #c4cae0; font-size: 14.5px; font-weight: 600; padding: 8px 12px; border-radius: 8px; }
.main-nav a:hover, .main-nav a.active { color: #fff; background: rgba(255,255,255,.07); }
.header-actions { display: flex; gap: 10px; align-items: center; }
.header-actions .btn { padding: 10px 16px; font-size: 14px; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid rgba(255,255,255,.2); color: #fff; border-radius: 8px; width: 42px; height: 40px; cursor: pointer; }
.nav-toggle span { display: block; width: 18px; height: 2px; background: #fff; margin: 4px auto; border-radius: 2px; }

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .main-nav, .header-actions { display: none; }
  .site-header.open .container { flex-wrap: wrap; height: auto; min-height: 70px; padding-top: 14px; padding-bottom: 18px; row-gap: 6px; }
  .site-header.open .main-nav, .site-header.open .header-actions { display: flex; flex-direction: column; width: 100%; margin-left: 0; }
  .site-header.open .main-nav { border-top: 1px solid rgba(255,255,255,.08); padding-top: 10px; order: 3; }
  .site-header.open .header-actions { order: 4; align-items: stretch; gap: 10px; padding-top: 8px; }
  .site-header.open .main-nav a { padding: 12px 8px; }
}

/* ---------------------------------------------------------------- Hero */
.hero { position: relative; background: var(--ink); color: #fff; overflow: hidden; padding: 92px 0 110px; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 56px 56px; mask-image: radial-gradient(ellipse 80% 70% at 60% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 60% 30%, #000 30%, transparent 75%);
}
.hero::after {
  content: ""; position: absolute; width: 760px; height: 760px; right: -220px; top: -320px; pointer-events: none;
  background: radial-gradient(circle, rgba(36,72,216,.55), rgba(36,72,216,0) 65%);
}
.hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: 1.08fr .92fr; gap: 64px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 18px;
}
.hero .eyebrow { color: #aebcff; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); padding: 7px 12px; border-radius: 999px; letter-spacing: .1em; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 0 4px rgba(61,220,151,.18); }
.hero h1 { color: #fff; font-size: clamp(40px, 5.4vw, 66px); line-height: 1.02; letter-spacing: -.035em; margin-bottom: 22px; }
.hero h1 .serif { color: #b7c4ff; font-size: 1.08em; }
.hero .lead { color: #b9c0d8; font-size: 19px; max-width: 560px; margin-bottom: 32px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 36px; }
.hero-ticks { display: flex; gap: 22px; flex-wrap: wrap; color: #9aa3c3; font-size: 14px; font-weight: 600; }
.hero-ticks span { display: inline-flex; align-items: center; gap: 8px; }
.hero-ticks svg { color: #3ddc97; }

/* Estimate card */
.estimate-card {
  background: #fff; color: var(--text); border-radius: 18px; padding: 28px; box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,.6); position: relative;
}
.estimate-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: 19px; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgba(120,145,255,.9), rgba(255,255,255,0) 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.estimate-card h3 { font-size: 20px; margin-bottom: 4px; }
.estimate-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-group input { position: absolute; opacity: 0; pointer-events: none; }
.chip-group label {
  font-size: 13.5px; font-weight: 600; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  color: var(--muted); transition: all .15s; margin: 0;
}
.chip-group label:hover { border-color: #c7cde0; color: var(--ink); }
.chip-group input:checked + label { background: var(--brand-50); border-color: var(--brand); color: var(--brand); }
.chip-group input:focus-visible + label { outline: 3px solid rgba(36,72,216,.3); }
.estimate-card .field-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--subtle); margin: 0 0 10px; display: block; }
.estimate-card .group { margin-bottom: 18px; }
.estimate-foot { font-size: 13px; color: var(--muted); margin: 14px 0 0; text-align: center; }

/* ---------------------------------------------------------------- Sections */
.section { padding: 100px 0; }
.section-tight { padding: 72px 0; }
.section-alt { background: var(--bg); }
.section-dark { background: var(--ink); color: #c4cae0; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-head { max-width: 680px; margin-bottom: 52px; }
.section-head.center { text-align: center; margin-left: auto; margin-right: auto; }
.section-head h2 { font-size: clamp(30px, 3.6vw, 44px); letter-spacing: -.03em; }
.section-head h2 .serif { color: var(--brand); }
.section-head p { color: var(--muted); font-size: 18px; margin: 0; }
.section-dark .section-head p { color: #9aa3c3; }

.trust-bar { border-bottom: 1px solid var(--line); background: #fff; }
.trust-bar .container { display: grid; grid-template-columns: repeat(4, 1fr); }
.trust-item { padding: 26px 22px; display: flex; gap: 14px; align-items: flex-start; border-right: 1px solid var(--line); }
.trust-item:last-child { border-right: 0; }
.trust-item strong { display: block; color: var(--ink); font-size: 15px; }
.trust-item span { color: var(--muted); font-size: 14px; }
.icon-tile {
  width: 42px; height: 42px; border-radius: 11px; background: var(--brand-50); color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.service-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; transition: transform .2s, box-shadow .2s, border-color .2s;
  display: flex; flex-direction: column;
}
.service-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #d6dbea; }
.service-card .icon-tile { margin-bottom: 20px; width: 48px; height: 48px; }
.service-card h3 { font-size: 20px; }
.service-card p { color: var(--muted); font-size: 15.5px; }
.service-card ul { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 8px; }
.service-card li { font-size: 14.5px; color: var(--text); padding-left: 24px; position: relative; }
.service-card li::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--brand-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' stroke='%232448d8' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/10px no-repeat;
}
.service-card .card-foot { margin-top: auto; padding-top: 22px; }

/* Work */
.work-card { border-radius: var(--radius); overflow: hidden; background: #fff; border: 1px solid var(--line); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.work-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.work-media { aspect-ratio: 16/10; background: linear-gradient(135deg, #eef1fb, #dfe5f8); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.work-media img { width: 100%; height: 100%; object-fit: cover; }
.work-media.contain img { object-fit: contain; padding: 34px; }
.work-media.app img { width: 42%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 22%; box-shadow: 0 20px 40px -14px rgba(11,16,32,.35); }
.work-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.work-body h3 { font-size: 19px; margin-bottom: 8px; }
.work-body p { color: var(--muted); font-size: 15px; }
.work-body .card-foot { margin-top: auto; padding-top: 6px; font-weight: 700; font-size: 14.5px; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); background: var(--brand-50); padding: 4px 9px; border-radius: 6px; margin-bottom: 12px; }

/* Process */
.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid rgba(255,255,255,.1); }
.process-step { padding: 32px 28px 8px 0; position: relative; }
.process-step .num { font-family: var(--serif); font-style: italic; font-size: 44px; color: #7f95ff; line-height: 1; display: block; margin-bottom: 18px; }
.process-step h3 { font-size: 19px; }
.process-step p { color: #9aa3c3; font-size: 15px; margin: 0; }
.process-step::before { content: ""; position: absolute; top: -1px; left: 0; width: 48px; height: 2px; background: var(--brand); }

/* Testimonials */
.quote-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; display: flex; flex-direction: column; }
.stars { color: var(--accent); letter-spacing: 2px; font-size: 16px; margin-bottom: 14px; }
.quote-card blockquote { margin: 0 0 24px; font-size: 18px; line-height: 1.55; color: var(--ink); font-weight: 500; }
.quote-card .who { display: flex; gap: 12px; align-items: center; margin-top: auto; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.who strong { display: block; color: var(--ink); font-size: 15px; }
.who span { color: var(--muted); font-size: 13.5px; }

/* Pricing */
.price-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 36px; box-shadow: var(--shadow); position: relative; }
.price-card.featured { border: 2px solid var(--brand); }
.price { display: flex; align-items: baseline; gap: 6px; margin: 12px 0 6px; }
.price strong { font-size: 54px; font-weight: 800; letter-spacing: -.04em; color: var(--ink); line-height: 1; }
.price span { color: var(--muted); font-weight: 600; }
.ribbon { position: absolute; top: -13px; left: 36px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 999px; letter-spacing: .04em; }
.check-list { list-style: none; padding: 0; margin: 22px 0 28px; display: grid; gap: 12px; }
.check-list li { padding-left: 30px; position: relative; font-size: 15.5px; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--green-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' stroke='%2312805c' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
}

/* CTA band */
.cta-band { background: var(--ink); border-radius: 22px; padding: 64px; color: #c4cae0; position: relative; overflow: hidden; display: grid; grid-template-columns: 1.4fr auto; gap: 40px; align-items: center; }
.cta-band::after { content: ""; position: absolute; width: 520px; height: 520px; right: -160px; bottom: -300px; background: radial-gradient(circle, rgba(36,72,216,.6), transparent 65%); }
.cta-band h2 { color: #fff; font-size: clamp(28px, 3.4vw, 40px); }
.cta-band p { margin: 0; font-size: 18px; color: #9aa3c3; }
.cta-band .actions { display: flex; gap: 12px; position: relative; z-index: 1; flex-wrap: wrap; }

/* Page hero (inner pages) */
.page-hero { background: var(--ink); color: #b9c0d8; padding: 76px 0 72px; position: relative; overflow: hidden; }
.page-hero::after { content: ""; position: absolute; width: 640px; height: 640px; right: -200px; top: -360px; background: radial-gradient(circle, rgba(36,72,216,.5), transparent 65%); }
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { color: #fff; font-size: clamp(36px, 4.6vw, 56px); letter-spacing: -.035em; max-width: 820px; }
.page-hero h1 .serif { color: #b7c4ff; }
.page-hero p { font-size: 19px; max-width: 640px; margin: 0; }
.page-hero .eyebrow { color: #aebcff; }

.prose { max-width: 760px; }
.prose h2 { font-size: 26px; margin-top: 1.6em; }
.prose p, .prose li { color: #3a4160; font-size: 16.5px; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 36px; }
.stat strong { display: block; font-size: 38px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); line-height: 1.1; }
.stat span { color: var(--muted); font-size: 14.5px; }

.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 32px; }
.filter-tabs button { font: 600 14px var(--font); padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; }
.filter-tabs button.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.faq details { border-bottom: 1px solid var(--line); padding: 20px 0; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--ink); font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 20px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; color: var(--brand); line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 12px 0 0; color: var(--muted); }

/* ---------------------------------------------------------------- Footer */
.site-footer { background: var(--ink); color: #8d97bb; padding: 72px 0 32px; font-size: 14.5px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 40px; margin-bottom: 48px; }
.site-footer h4 { color: #fff; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 16px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.site-footer a { color: #b9c0d8; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding-top: 24px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Forms */
.form-row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.form-row.three { grid-template-columns: 2fr 1fr 1fr; }
.field { margin-bottom: 18px; }
label, .label { display: block; font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 7px; }
.label-hint { font-weight: 500; color: var(--subtle); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; font: 500 15px/1.4 var(--font); color: var(--text); background: #fff; border: 1px solid #d5d9e6; border-radius: 10px;
  padding: 12px 14px; transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
select { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 8l4 4 4-4' stroke='%235d6582' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") right 12px center/18px no-repeat; padding-right: 38px; }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(36,72,216,.12); }
input::placeholder, textarea::placeholder { color: #a3a9bf; }
.help { font-size: 13px; color: var(--subtle); margin-top: 6px; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: 14.5px; color: var(--text); cursor: pointer; }
.checkbox input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.segmented input { position: absolute; opacity: 0; }
.segmented label { border: 1px solid #d5d9e6; border-radius: 12px; padding: 14px 16px; cursor: pointer; margin: 0; font-weight: 700; display: flex; gap: 12px; align-items: center; transition: all .15s; }
.segmented label small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }
.segmented input:checked + label { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 1px var(--brand) inset; }

/* ---------------------------------------------------------------- Auth pages */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #fff; }
.auth-side { background: var(--ink); color: #b9c0d8; padding: 48px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; width: 700px; height: 700px; left: -200px; bottom: -380px; background: radial-gradient(circle, rgba(36,72,216,.55), transparent 65%); }
.auth-side > * { position: relative; z-index: 1; }
.auth-side h2 { color: #fff; font-size: 38px; letter-spacing: -.03em; margin-top: auto; }
.auth-side h2 .serif { color: #b7c4ff; }
.auth-side ul { list-style: none; padding: 0; margin: 24px 0 auto; display: grid; gap: 14px; }
.auth-side li { display: flex; gap: 12px; align-items: center; }
.auth-side li .icon-tile { background: rgba(255,255,255,.07); color: #b7c4ff; width: 36px; height: 36px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card.wide { max-width: 560px; }
.auth-card h1 { font-size: 30px; letter-spacing: -.03em; }
.auth-card .sub { color: var(--muted); margin-bottom: 28px; }
.auth-foot { margin-top: 22px; font-size: 14.5px; color: var(--muted); text-align: center; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--subtle); font-size: 13px; margin: 22px 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------------------------------------------------------------- Alerts */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 11px; margin-bottom: 18px; font-size: 14.5px; font-weight: 500; border: 1px solid; }
.alert-icon { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex: none; color: #fff; margin-top: 1px; }
.alert-success { background: var(--green-bg); border-color: #bfe6d5; color: #0b5a40; } .alert-success .alert-icon { background: var(--green); }
.alert-error { background: var(--red-bg); border-color: #f5c9c4; color: #8c2219; } .alert-error .alert-icon { background: var(--red); }
.alert-info { background: var(--blue-bg); border-color: #c9d6fb; color: #173a93; } .alert-info .alert-icon { background: var(--blue); }
.alert-warning { background: var(--amber-bg); border-color: #f4dbaa; color: #7a4600; } .alert-warning .alert-icon { background: #c27a10; }

/* ---------------------------------------------------------------- Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-violet { background: var(--violet-bg); color: var(--violet); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-gray { background: var(--gray-bg); color: var(--gray); }
.pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 6px; background: var(--gray-bg); color: var(--gray); }

/* ==========================================================================
   App shell (client portal + staff dashboard)
   ========================================================================== */
body.app { background: var(--bg); }
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; background: linear-gradient(90deg, var(--ink) 260px, var(--bg) 260px); }
.sidebar { background: var(--ink); color: #9aa3c3; padding: 22px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.sidebar .brand { padding: 4px 10px 22px; }
.side-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #5f6a91; padding: 18px 12px 8px; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 12px; color: #b3bad4; font-weight: 600; font-size: 14.5px; padding: 10px 12px; border-radius: 9px; }
.side-nav a svg { width: 18px; height: 18px; opacity: .8; flex: none; }
.side-nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.side-nav a.active { background: rgba(255,255,255,.09); color: #fff; box-shadow: inset 2px 0 0 #7f95ff; }
.side-nav .count { margin-left: auto; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.side-user { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding: 16px 8px 0; display: flex; gap: 10px; align-items: center; }
.side-user .avatar { background: var(--brand); }
.side-user strong { display: block; color: #fff; font-size: 14px; line-height: 1.2; }
.side-user span { font-size: 12.5px; }
.side-user a { margin-left: auto; color: #8d97bb; font-size: 13px; font-weight: 600; }

.app-main { min-width: 0; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); height: 64px; display: flex; align-items: center; gap: 16px; padding: 0 32px; position: sticky; top: 0; z-index: 20; }
.topbar .menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; width: 40px; height: 38px; cursor: pointer; }
.topbar .crumbs { font-size: 14px; color: var(--muted); font-weight: 600; }
.topbar .crumbs a { color: var(--muted); }
.topbar .crumbs a:hover { color: var(--ink); }
.topbar .spacer { flex: 1; }
.app-content { padding: 32px; max-width: 1240px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-header h1 { font-size: 28px; margin: 0; letter-spacing: -.03em; }
.page-header p { color: var(--muted); margin: 6px 0 0; }
.page-header .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 20px; }
.card-header { padding: 18px 22px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-header h2, .card-header h3 { font-size: 16px; margin: 0; letter-spacing: -.01em; }
.card-body { padding: 22px; }
.card-body.flush { padding: 0; }
.card-footer { padding: 16px 22px; border-top: 1px solid var(--line-2); background: #fbfbfd; border-radius: 0 0 var(--radius) var(--radius); }

.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.stack > * + * { margin-top: 20px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 26px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.stat-card .k { font-size: 13px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.stat-card .v { font-size: 30px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); margin-top: 6px; line-height: 1.1; }
.stat-card .d { font-size: 13px; color: var(--subtle); margin-top: 4px; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--subtle); padding: 12px 22px; background: #fbfbfd; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table td { padding: 14px 22px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbff; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table a.row-link { color: var(--ink); font-weight: 700; }
.table a.row-link:hover { color: var(--brand); }
.table .meta { color: var(--subtle); font-size: 13px; display: block; margin-top: 1px; }

.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .icon-tile { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 14px; }
.empty h3 { font-size: 17px; margin-bottom: 4px; }

.dl { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; margin: 0; font-size: 14.5px; }
.dl dt { color: var(--subtle); font-weight: 600; }
.dl dd { margin: 0; color: var(--ink); font-weight: 500; word-break: break-word; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar input[type=search] { max-width: 280px; padding: 10px 14px; }
.toolbar select { width: auto; padding: 10px 38px 10px 14px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 700; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--ink); border-color: var(--brand); }
.tabs a .n { font-size: 12px; background: var(--gray-bg); padding: 1px 7px; border-radius: 999px; margin-left: 4px; }

.progress { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #6a86ff); border-radius: 999px; }
.progress-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }

.timeline-steps { display: flex; gap: 6px; }
.timeline-steps span { flex: 1; height: 6px; border-radius: 999px; background: var(--line); }
.timeline-steps span.done { background: var(--brand); }
.steps-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--subtle); margin-top: 8px; font-weight: 600; }

/* Thread */
.thread { display: grid; gap: 16px; }
.msg { display: flex; gap: 12px; }
.msg-body { background: var(--bg); border-radius: 4px 12px 12px 12px; padding: 12px 15px; flex: 1; font-size: 14.5px; }
.msg.staff .msg-body { background: var(--brand-50); }
.msg.internal .msg-body { background: #fff8e6; border: 1px dashed #efcf86; }
.msg-meta { font-size: 12.5px; color: var(--subtle); margin-bottom: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.msg-meta strong { color: var(--ink); font-size: 13.5px; }
.msg-body p:last-child { margin: 0; }

/* Quote document */
.quote-doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.quote-doc-head { padding: 36px 40px; display: flex; justify-content: space-between; gap: 30px; border-bottom: 1px solid var(--line-2); }
.quote-doc-head .brand { color: var(--ink); }
.quote-doc-head .brand small { color: var(--subtle); }
.quote-meta { text-align: right; font-size: 14px; color: var(--muted); }
.quote-meta strong { color: var(--ink); }
.quote-meta .qnum { white-space: nowrap; font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; display: block; margin-bottom: 6px; }
.quote-doc-body { padding: 32px 40px; }
.quote-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 30px; font-size: 14.5px; }
.quote-parties h4 { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--subtle); margin-bottom: 8px; }
.quote-items { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.quote-items th { text-align: left; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--subtle); padding: 10px 0; border-bottom: 2px solid var(--ink); }
.quote-items td { padding: 14px 0; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.quote-items .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; padding-left: 16px; }
.quote-items .details { display: block; color: var(--muted); font-size: 13.5px; margin-top: 3px; white-space: pre-line; }
.quote-totals { margin-left: auto; width: 100%; max-width: 340px; margin-top: 18px; font-size: 15px; }
.quote-totals div { display: flex; justify-content: space-between; padding: 7px 0; font-variant-numeric: tabular-nums; }
.quote-totals .grand { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 12px; font-size: 20px; font-weight: 800; color: var(--ink); }
.quote-totals .monthly { color: var(--brand); font-weight: 700; }
.quote-section { margin-top: 30px; font-size: 14.5px; color: #3a4160; }
.quote-section h4 { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--subtle); margin-bottom: 8px; }
.signature { font-family: var(--serif); font-style: italic; font-size: 30px; color: var(--ink); line-height: 1.1; }

.decision-card { border: 2px solid var(--brand); }
.items-editor td { padding: 8px 6px; vertical-align: top; }
.items-editor input, .items-editor select, .items-editor textarea { padding: 9px 10px; font-size: 14px; }
.items-editor textarea { min-height: 38px; height: 38px; }
.items-editor .col-desc { min-width: 240px; }
.items-editor .col-qty { width: 80px; }
.items-editor .col-price { width: 120px; }
.items-editor .col-bill { width: 130px; }
.items-editor .col-total { width: 110px; text-align: right; font-weight: 700; padding-top: 16px; font-variant-numeric: tabular-nums; }
.icon-btn { background: none; border: 1px solid var(--line); border-radius: 8px; width: 36px; height: 36px; cursor: pointer; color: var(--subtle); display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { color: var(--red); border-color: #f2c7c2; }

.pagination { display: flex; gap: 6px; padding: 16px 22px; }
.pagination a { min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; font-weight: 700; font-size: 14px; color: var(--muted); }
.pagination a.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 14px 22px; border-bottom: 1px solid var(--line-2); display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.list-plain li:last-child { border-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.mt-2 { margin-top: 20px; } .mb-2 { margin-bottom: 20px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.inline-form { display: inline; }
.notice-box { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; font-size: 14.5px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--gray-bg); padding: 2px 6px; border-radius: 5px; word-break: break-all; }
.paypal-box { min-height: 50px; }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1100px) {
  .grid-4, .stats { grid-template-columns: repeat(2, 1fr); }
  .layout-2 { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .hero .container { grid-template-columns: 1fr; gap: 48px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .process { grid-template-columns: 1fr 1fr; }
  .trust-bar .container { grid-template-columns: 1fr 1fr; }
  .trust-item:nth-child(2) { border-right: 0; }
  .trust-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cta-band { grid-template-columns: 1fr; padding: 44px 32px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .app-shell { grid-template-columns: 1fr; background: var(--bg); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(11,16,32,.4); z-index: 55; }
  .topbar .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .topbar { padding: 0 18px; }
  .app-content { padding: 22px 18px; }
}
@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .section { padding: 72px 0; }
  .grid-2, .grid-3, .grid-4, .stats, .form-row, .form-row.three, .stat-row, .quote-parties { grid-template-columns: 1fr; }
  .process { grid-template-columns: 1fr; }
  .trust-bar .container { grid-template-columns: 1fr; }
  .trust-item { border-right: 0; border-bottom: 1px solid var(--line); }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 64px 0 80px; }
  .estimate-card { padding: 22px; }
  .quote-doc-head, .quote-doc-body { padding: 24px 20px; }
  .quote-meta { text-align: left; }
  .quote-doc-head { flex-direction: column; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 10px; }
  .segmented { grid-template-columns: 1fr; }
  .table th, .table td { padding: 12px 14px; }
}

@media print {
  .sidebar, .topbar, .no-print, .site-header, .site-footer { display: none !important; }
  body.app { background: #fff; }
  .app-shell { display: block; }
  .app-content { padding: 0; }
  .quote-doc { box-shadow: none; border: 0; }
  .layout-2 { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------- Presence + Team Chat */
.avatar-wrap { position: relative; display: inline-flex; flex: none; }
.presence-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #b7bdcf; border: 2px solid #fff; }
.presence-dot.on { background: #22c55e; }
.presence-text { display: block; font-size: 12.5px; font-weight: 600; color: var(--subtle); }
.presence-text.on { color: var(--green); }
.chat-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
.chat-list li { padding: 0; }
.chat-list li.active { background: var(--brand-50); }
.chat-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; color: inherit; width: 100%; }
.chat-row:hover { background: #fafbff; color: inherit; }
.chat-row-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-row-text strong { color: var(--ink); font-size: 14.5px; }
.chat-row-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; color: var(--subtle); white-space: nowrap; }
.count-pill { background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.chat-panel { display: flex; flex-direction: column; min-height: 560px; }
.chat-panel .card-header h2 { margin-bottom: 2px; }
.chat-log { flex: 1; height: 58vh; min-height: 360px; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 6px; background: #fbfbfd; }
.chat-day { align-self: center; font-size: 11.5px; font-weight: 700; color: var(--subtle); text-transform: uppercase; letter-spacing: .06em; margin: 10px 0 4px; }
.bubble-wrap { display: flex; flex-direction: column; align-items: flex-start; }
.bubble-wrap.mine { align-items: flex-end; }
.bubble { max-width: 75%; padding: 9px 13px; border-radius: 18px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.bubble.mine { background: var(--brand); color: #fff; border-bottom-right-radius: 5px; }
.bubble.theirs { background: #fff; border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 5px; }
.bubble-time { font-size: 11px; color: var(--subtle); margin: 2px 6px 0; }
.seen { align-self: flex-end; font-size: 11.5px; font-weight: 600; color: var(--subtle); margin-right: 6px; }
.chat-compose { display: flex; gap: 10px; align-items: flex-end; padding: 14px 18px 8px; border-top: 1px solid var(--line-2); }
.chat-compose textarea { min-height: 46px; max-height: 160px; resize: none; border-radius: 22px; padding: 12px 16px; }
.chat-compose .btn { border-radius: 50%; width: 46px; height: 46px; padding: 0; flex: none; }
@media (max-width: 960px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-log { height: 55vh; }
}

/* ---------------------------------------------------------------- Project files */
.file-list li { align-items: flex-start; justify-content: flex-start; gap: 14px; }
.file-thumb { width: 56px; height: 56px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; flex: none; }
.file-thumb.lg { width: 120px; height: 90px; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-ext { font-size: 11px; font-weight: 800; color: var(--brand); letter-spacing: .04em; }
.file-name { font-weight: 700; color: var(--ink); word-break: break-word; }
.approval-item { display: flex; gap: 16px; align-items: flex-start; border-bottom: 1px solid var(--line-2); }
.approval-item:last-child { border-bottom: 0; }
.inline-details { display: inline-block; }
.inline-details summary { list-style: none; cursor: pointer; }
.inline-details summary::-webkit-details-marker { display: none; }
.inline-details[open] { display: block; width: 100%; margin-top: 8px; }
input[type=file] { width: 100%; font: 500 14px var(--font); padding: 10px; border: 1px dashed #c8cede; border-radius: 10px; background: var(--bg); }
