:root {
  --brand-obsidian: #171715;
  --brand-obsidian-soft: #292925;
  --brand-maize: #f6b900;
  --brand-cochineal: #a8252c;
  --brand-manila: #f5e7c8;
  --brand-paper: #fff9eb;
  --brand-cobalt: #1646c6;
  --brand-cobalt-deep: #0e2f92;
  --brand-nopal: #0b7a53;
  --brand-nopal-signal: #00a878;
  --green: var(--brand-cobalt);
  --green-dark: var(--brand-cobalt-deep);
  --green-soft: #e0e7fb;
  --orange: var(--brand-cochineal);
  --orange-soft: #f7ded9;
  --ink: var(--brand-obsidian);
  --ink-soft: #62625b;
  --soft: #62625b;
  --paper: var(--brand-manila);
  --paper-bright: var(--brand-paper);
  --white: var(--brand-paper);
  --line: rgba(23, 23, 21, 0.2);
  --shadow: 8px 10px 0 rgba(23, 23, 21, 0.1);
}

body {
  background-color: var(--brand-manila);
  background-image:
    radial-gradient(circle at 88% 8%, rgba(22, 70, 198, .08), transparent 28%),
    radial-gradient(circle at 6% 80%, rgba(11, 122, 83, .07), transparent 24%),
    linear-gradient(rgba(23, 23, 21, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 23, 21, 0.035) 1px, transparent 1px);
  background-repeat: no-repeat, no-repeat, repeat, repeat;
  background-size: auto, auto, 30px 30px, 30px 30px;
}

.route-field-surface {
  color: var(--brand-paper);
  background-color: var(--brand-obsidian);
  background-image:
    linear-gradient(100deg, rgba(13, 13, 12, 0.99) 0%, rgba(13, 13, 12, 0.92) 40%, rgba(13, 13, 12, 0.46) 75%, rgba(13, 13, 12, 0.24) 100%),
    url("/assets/brand/sellaruta-federal-world.webp");
  background-position: center;
  background-size: cover;
}

.brand-hero {
  position: relative;
  isolation: isolate;
  min-height: 0;
  padding: clamp(40px, 5vw, 68px);
  overflow: hidden;
  border: 2px solid var(--brand-obsidian);
  border-radius: 18px;
  box-shadow: 12px 14px 0 rgba(23, 23, 21, 0.15);
}

.brand-hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 24%),
    linear-gradient(112deg, transparent 0 64%, rgba(22, 70, 198, .22) 64% 71%, transparent 71% 77%, rgba(0, 168, 120, .16) 77% 80%, transparent 80%),
    repeating-linear-gradient(90deg, transparent 0 48px, rgba(246, 185, 0, 0.075) 48px 50px);
  content: "";
  pointer-events: none;
}

.brand-hero::after {
  position: absolute;
  z-index: 0;
  top: 22px;
  right: 24px;
  width: 72px;
  height: 72px;
  background: url("/assets/brand/logo/sellaruta-mark.svg") center / contain no-repeat;
  content: "";
  filter: drop-shadow(8px 9px 0 rgba(0, 0, 0, 0.25));
  opacity: 0.95;
  pointer-events: none;
}

.brand-hero > * { position: relative; z-index: 1; }
body .brand-hero .eyebrow,
body .brand-hero > div:first-child > .eyebrow { color: var(--brand-maize); }
body .brand-hero h1,
body .brand-hero h2,
body .brand-hero .story-lede strong,
body .brand-hero .hero-lede strong { color: var(--brand-paper); }
body .brand-hero .story-lede,
body .brand-hero .hero-lede,
body .brand-hero .hero-copy > p:last-child,
body .brand-hero.setup-hero > div:first-child > p:last-child,
body .brand-hero.workspace-hero > div:first-child > p:last-child,
body .brand-hero .microcopy { color: rgba(255, 249, 235, 0.72); }
body .brand-hero h1 em { color: var(--brand-maize); }

.route-glass {
  color: var(--brand-obsidian);
  background: rgba(245, 231, 200, 0.94);
  border: 2px solid var(--brand-obsidian);
  border-radius: 12px !important;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.28);
  backdrop-filter: none;
}
.brand-hero .route-glass { align-self: stretch; }
.brand-hero .route-glass :is(strong, h2, h3) { color: var(--brand-obsidian); }
.brand-hero .route-glass :is(p, small) { color: #55554f; }

.brand-hero .button-primary,
.brand-hero .primary-button {
  color: white;
  background: var(--brand-cochineal);
  border-color: var(--brand-obsidian);
  box-shadow: 5px 6px 0 rgba(0, 0, 0, 0.34);
}
.brand-hero .button-secondary {
  color: var(--brand-paper);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.42);
}
.brand-hero .security-list > div {
  background: rgba(23, 23, 21, 0.84);
  border-color: rgba(246, 185, 0, 0.35);
  border-radius: 8px;
}
.brand-hero .security-list span { color: var(--brand-obsidian); background: var(--brand-maize); border-radius: 3px; }
.brand-hero .security-list p { color: rgba(255, 249, 235, 0.65); }
.brand-hero .security-list strong { color: var(--brand-paper); }

.route-brief {
  display: grid;
  gap: 10px;
  max-width: 680px;
  min-height: 138px;
  margin-top: 28px;
  padding: 20px 22px;
  align-content: end;
  border-radius: 8px;
}
.route-brief > span { color: var(--brand-cobalt); font-size: .66rem; font-weight: 950; letter-spacing: .14em; text-transform: uppercase; }
.route-brief > strong { display: flex; flex-wrap: wrap; gap: 7px 11px; align-items: center; color: var(--brand-obsidian); font-size: clamp(1rem, 2vw, 1.2rem); }
.route-brief b { font-weight: 900; }
.route-brief i { color: var(--brand-cobalt); font-style: normal; }

:is(.account-header, .setup-header, .dashboard-header, .site-header) {
  background: rgba(245, 231, 200, 0.96);
  border-bottom: 2px solid var(--brand-obsidian);
  box-shadow: none;
  backdrop-filter: none;
}

.brand-mark { position: relative; isolation: isolate; display: grid; flex: 0 0 auto; overflow: visible; place-items: center; color: transparent; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.brand-mark::after { display: none; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(4px 5px 0 rgba(23, 23, 21, 0.14)); }
.brand strong { color: var(--brand-obsidian); font-weight: 900; letter-spacing: -.035em; }
.brand small { color: var(--ink-soft); }

:is(.auth-card, .wizard-card, .owner-invite, .setup-form, .setup-card, .access-card, .dashboard-card, .panel, .section-shell) {
  background-color: rgba(255, 249, 235, 0.92);
  border-color: var(--brand-obsidian);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

:is(.auth-card, .wizard-card, .setup-form, .dashboard-card, .panel) :is(.eyebrow, .label, legend) {
  letter-spacing: .08em;
}

:is(input, select, textarea) { background-color: var(--brand-paper); border-color: rgba(23, 23, 21, .28); border-radius: 8px; }
:is(input, select, textarea):focus { border-color: var(--brand-cobalt) !important; box-shadow: 0 0 0 4px rgba(22, 70, 198, .14) !important; }

:is(.primary-button, .nav-button, .button-primary) {
  color: white;
  background: var(--brand-cochineal);
  border-color: var(--brand-obsidian);
  border-radius: 8px;
  box-shadow: 4px 5px 0 rgba(23, 23, 21, .22);
}

:is(.primary-button, .secondary-button, .back-button, .button, .quick-actions a, .preset-grid button, .nav-button) {
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background-color 150ms ease;
}
:is(.primary-button, .secondary-button, .button, .quick-actions a, .preset-grid button, .nav-button):hover { transform: translate(-2px, -2px); }
:is(.primary-button, .secondary-button, .button, .nav-button):active { transform: translate(0, 0); box-shadow: none; }

.progress-fill, .progress-bar > span, .progress-card i, .readiness-card i, .progress-track span, .checklist-progress i { background: var(--brand-cobalt) !important; }
.ready-banner, .success-banner { color: white; background: var(--brand-nopal); border-color: var(--brand-obsidian); }
.step-number, .nav-number, .status-badge { border-radius: 3px !important; }
.active :is(.step-number, .nav-number), .step-number.active,
:is(.step-sidebar, .step-nav) > button.active > span { color: white !important; background: var(--brand-cobalt) !important; }
:is(.step-sidebar, .step-nav) > button.complete i,
.preflight-item.complete > span:first-child { color: white !important; background: var(--brand-nopal) !important; }
.status-pill.ready, .status-pill.connected, .pilot-card.ready { color: white !important; background: var(--brand-nopal) !important; }

.brand-hero .hero-status::after { opacity: .2; }
.phone { --preview-primary: var(--brand-cobalt); --preview-accent: var(--brand-nopal-signal); border: 3px solid var(--brand-obsidian); border-radius: 24px; box-shadow: 8px 9px 0 rgba(23, 23, 21, .18); }
.phone-bar .preview-brand-mark { display: grid; place-items: center; padding: 5px; background: var(--brand-cobalt); border-radius: 5px; }
.phone-bar .preview-brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.phone-bar .preview-brand-mark.has-initials { color: var(--brand-obsidian); background: var(--preview-accent, var(--brand-maize)); }

:focus-visible { outline-color: var(--brand-cobalt); }

@media (min-width: 701px) {
  .auth-shell { align-items: start; }
  .auth-story.brand-hero h1 { font-size: clamp(3.55rem, 5.5vw, 5.6rem); letter-spacing: -.055em; }
}

main > .hero.brand-hero { min-height: 0; padding: clamp(44px, 5vw, 66px); }
main > .hero.brand-hero h1 { font-size: clamp(3.3rem, 6vw, 5.9rem); letter-spacing: -.06em; }
main > .hero.brand-hero .hero-status { min-height: 390px; }

@media (max-width: 900px) {
  .brand-hero { padding: clamp(30px, 7vw, 46px); }
}

@media (max-width: 680px) {
  :is(.step-sidebar, .step-nav) {
    grid-auto-flow: column;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 10px;
    scroll-snap-type: inline mandatory;
    scrollbar-color: var(--brand-cobalt) rgba(22, 70, 198, .12);
  }
  .step-sidebar { grid-template-columns: repeat(5, minmax(150px, 1fr)); }
  .step-nav { grid-template-columns: repeat(6, minmax(150px, 1fr)); }
  :is(.step-sidebar, .step-nav) > button { min-width: 0; scroll-snap-align: start; }
  .account-header {
    color: var(--brand-obsidian) !important;
    background: var(--brand-manila) !important;
  }
  .account-header .brand { position: relative; z-index: 2; display: inline-flex !important; flex: 0 1 auto; min-width: 0; }
  .account-header nav a { display: none !important; }
  .account-header nav { flex: 0 0 auto; min-width: 0; }
  .account-header nav button {
    display: inline-flex !important;
    flex: 0 0 auto;
    width: auto !important;
    min-width: 0;
    min-height: 44px;
    padding: 0 10px !important;
    align-items: center;
  }
  .workspace-hero { grid-template-columns: minmax(0, 1fr); }
  .workspace-hero > div:first-child { min-width: 0; }
  .auth-story.brand-hero h1,
  .workspace-hero.brand-hero h1 {
    max-width: 100%;
    font-size: clamp(2.35rem, 12.3vw, 3.05rem) !important;
    line-height: .92;
    letter-spacing: -.05em;
    overflow-wrap: anywhere;
  }
  .route-field-surface {
    background-image:
      linear-gradient(155deg, rgba(13, 13, 12, .98) 0%, rgba(13, 13, 12, .88) 56%, rgba(13, 13, 12, .44) 100%),
      url("/assets/brand/sellaruta-federal-world-mobile.webp");
    background-position: center;
  }
  .brand-hero { padding: 28px 20px; border-radius: 14px; box-shadow: 7px 8px 0 rgba(23, 23, 21, .14); }
  .brand-hero::after { top: 15px; right: 15px; width: 48px; height: 48px; }
  .auth-story.brand-hero { margin-bottom: 18px; }
  .auth-story.brand-hero .route-brief { display: none; }
  .auth-story.brand-hero .security-list { gap: 7px; margin: 24px 0 0; }
  .auth-story.brand-hero .security-list > div { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: center; min-height: 0; padding: 12px 14px; border-radius: 7px; }
  .auth-story.brand-hero .security-list p { gap: 2px; margin: 0; font-size: .76rem; }
  .auth-story.brand-hero .security-list strong { font-size: .88rem; }
  main > .hero.brand-hero { gap: 22px; padding: 28px 18px; }
  main > .hero.brand-hero h1 { font-size: clamp(2.85rem, 12vw, 3.6rem); }
  main > .hero.brand-hero .hero-lede { margin-top: 22px; }
  main > .hero.brand-hero .hero-actions { gap: 9px; margin-top: 24px; }
  main > .hero.brand-hero .hero-status { min-height: 280px; padding: 26px; }
  main > .hero.brand-hero .status-orbit { margin-bottom: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  :is(.primary-button, .secondary-button, .back-button, .button, .quick-actions a, .preset-grid button, .nav-button) { transition: none; }
}
