:root {
  color-scheme: light;
  font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-10: 2.5rem;
  --space-16: 4rem;
  --consumer-background: #f8f9fa;
  --consumer-ink: #041920;
  --consumer-text: #191c1d;
  --consumer-muted: #586267;
  --consumer-soft: #edf1f2;
  --consumer-border: #c8d0d3;
  --blue: #0f62fe;
  --blue-hover: #0353e9;
  --ink: #161616;
  --muted: #525252;
  --surface: #ffffff;
  --surface-soft: #f4f4f4;
  --surface-strong: #e0e0e0;
  --border: #c6c6c6;
  --success: #198038;
  --success-soft: #defbe6;
  --danger: #da1e28;
  --danger-soft: #fff1f1;
  --warning: #8e6a00;
  --warning-soft: #fff8e1;
  --focus: #0f62fe;
  --action: var(--consumer-ink);
  --action-hover: #12323b;
  --page-background: var(--consumer-background);
  --text: var(--consumer-text);
  --muted-text: var(--consumer-muted);
  --color-border: var(--consumer-border);
  --sidebar-width: 17rem;
  --header-height: 4.5rem;
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --shadow-sm: 0 1px 2px rgb(4 25 32 / 8%);
  --shadow-md: 0 10px 30px rgb(4 25 32 / 10%);
}

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

html {
  min-width: 20rem;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--page-background);
  color: var(--text);
}

body.operational-surface {
  --action: var(--blue);
  --action-hover: var(--blue-hover);
  --page-background: #ffffff;
  --text: var(--ink);
  --muted-text: var(--muted);
  --color-border: var(--border);
  --radius-md: 0.25rem;
  --radius-lg: 0.5rem;
}

img,
svg {
  max-width: 100%;
}

button,
input,
select,
textarea {
  max-width: 100%;
  font: inherit;
}

button,
select,
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
}

a {
  color: var(--action);
  font-weight: 600;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--action-hover);
}

p,
ul,
ol,
dl {
  max-width: 72ch;
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
h4 {
  color: var(--text);
  line-height: 1.15;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.125rem;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.demo-banner {
  position: relative;
  z-index: 80;
  width: 100%;
  max-width: none;
  margin: 0;
  border: 0;
  border-bottom: 1px solid #ff8389;
  border-radius: 0;
  background: var(--danger-soft);
  color: #750e13;
  text-align: center;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-2) clamp(var(--space-4), 4vw, var(--space-10));
  border-bottom: 1px solid var(--color-border);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(12px);
}

.brand-lockup {
  display: flex;
  min-width: max-content;
  align-items: baseline;
  gap: var(--space-2);
}

.site-name {
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.environment-label {
  color: var(--muted-text);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.account-navigation {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--space-4);
  margin-inline-start: auto;
  font-size: 0.875rem;
  white-space: nowrap;
}

.account-navigation > a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  color: var(--muted-text);
  text-decoration: none;
}

.account-navigation > a:hover {
  color: var(--text);
}

.account-navigation > a:last-of-type {
  padding-inline: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--action);
  color: #ffffff;
}

.language-switcher {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.language-switcher label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.language-switcher select,
.language-switcher button {
  min-height: 2.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

.language-switcher select {
  width: auto;
  padding: 0 var(--space-6) 0 var(--space-2);
  border: 1px solid var(--color-border);
  background: var(--surface);
}

.language-switcher button {
  padding-inline: var(--space-2);
  border: 0;
  background: transparent;
  color: var(--action);
}

.application-frame {
  min-height: calc(100vh - var(--header-height));
}

.page-shell {
  width: min(100% - 2rem, 78rem);
  margin-inline: auto;
  padding-block: clamp(var(--space-6), 5vw, var(--space-16));
}

.page-heading {
  margin-bottom: var(--space-10);
}

.page-heading::after {
  display: block;
  width: 3rem;
  height: 0.25rem;
  margin-top: var(--space-4);
  background: var(--action);
  content: "";
}

.message-list {
  display: grid;
  gap: var(--space-2);
  margin-block: var(--space-4);
}

/* Role navigation */
.role-navigation {
  display: flex;
  gap: var(--space-1);
}

.role-navigation__title {
  color: var(--text);
  font-size: 1.05rem;
}

.role-navigation a {
  display: flex;
  min-height: 3rem;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  border-left: 3px solid transparent;
  color: var(--muted-text);
  font-size: 0.875rem;
  text-decoration: none;
}

.role-navigation a:hover,
.role-navigation a:focus-visible {
  border-left-color: var(--action);
  background: color-mix(in srgb, var(--action) 9%, transparent);
  color: var(--action);
}

.role-navigation--renter {
  position: sticky;
  top: var(--header-height);
  z-index: 50;
  width: 100%;
  align-items: center;
  justify-content: center;
  overflow-x: auto;
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--consumer-border);
  background: rgb(255 255 255 / 96%);
  scrollbar-width: thin;
}

.role-navigation--renter .role-navigation__title {
  display: none;
}

.role-navigation--renter a {
  flex: 0 0 auto;
  border: 0;
  border-bottom: 2px solid transparent;
}

.role-navigation--renter a:hover,
.role-navigation--renter a:focus-visible {
  border-bottom-color: var(--consumer-ink);
  background: transparent;
  color: var(--consumer-ink);
}

/* Owner and staff operational shells */
.owner-surface .site-header,
.staff-surface .site-header {
  width: calc(100% - var(--sidebar-width));
  margin-left: var(--sidebar-width);
}

.owner-surface .application-frame,
.staff-surface .application-frame {
  min-height: calc(100vh - var(--header-height));
}

.owner-surface .page-shell,
.staff-surface .page-shell {
  width: calc(100% - var(--sidebar-width));
  max-width: none;
  margin: 0 0 0 var(--sidebar-width);
  padding: clamp(var(--space-6), 4vw, var(--space-10));
}

.role-navigation--owner,
.role-navigation--staff {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 70;
  width: var(--sidebar-width);
  flex-direction: column;
  overflow-y: auto;
  padding: var(--space-6) var(--space-4);
  border-right: 1px solid var(--border);
  background: var(--surface-soft);
}

.role-navigation--owner .role-navigation__title,
.role-navigation--staff .role-navigation__title {
  display: block;
  margin: 0 var(--space-2) var(--space-10);
}

.staff-surface .page-heading,
.owner-surface .page-heading {
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.staff-surface .page-heading h1,
.owner-surface .page-heading h1 {
  font-size: clamp(1.75rem, 3vw, 2.6rem);
  font-weight: 400;
}

/* Account split-screen shell */
.account-surface {
  --page-background: #ffffff;
  --text: var(--ink);
  --muted-text: var(--muted);
  --color-border: var(--border);
  --action: var(--blue);
  --action-hover: var(--blue-hover);
}

.account-surface .site-header {
  position: fixed;
  inset: 0 auto 0 0;
  width: 50%;
  height: 100vh;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(var(--space-10), 8vw, 7.5rem);
  border: 0;
  background: #161616;
  color: #ffffff;
}

.account-surface .brand-lockup {
  flex-direction: column;
  gap: var(--space-4);
}

.account-surface .site-name {
  color: #ffffff;
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 300;
}

.account-surface .environment-label {
  color: #c6c6c6;
  font-size: 0.8rem;
}

.account-surface .account-navigation {
  width: 100%;
  flex-wrap: wrap;
  align-items: flex-start;
  margin: auto 0 0;
  white-space: normal;
}

.account-surface .account-navigation > a,
.account-surface .language-switcher button {
  color: #f4f4f4;
}

.account-surface .account-navigation > a:last-of-type {
  background: var(--blue);
}

.account-surface .language-switcher select {
  border-color: #525252;
  background: #262626;
  color: #ffffff;
}

.account-surface .page-shell {
  width: 50%;
  max-width: none;
  min-height: 100vh;
  margin: 0 0 0 50%;
  padding: clamp(var(--space-10), 8vw, 7.5rem) clamp(var(--space-6), 10vw, 10rem);
}

.account-surface .page-heading,
.account-surface .page-shell > :not(.page-heading):not(.message-list) {
  width: min(100%, 34rem);
  margin-inline: auto;
}

.account-surface .page-heading h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
}

/* Public hero */
.home-surface .page-shell {
  position: relative;
  width: 100%;
  min-height: calc(100vh - var(--header-height));
  padding: clamp(4rem, 12vw, 9rem) clamp(var(--space-4), 6vw, 6rem);
  background:
    linear-gradient(90deg, rgb(248 249 250 / 98%) 0%, rgb(248 249 250 / 91%) 47%, rgb(248 249 250 / 20%) 76%),
    url("../img/flexivan-hero.svg") right center / min(58rem, 70vw) auto no-repeat,
    var(--consumer-background);
}

.home-surface .page-heading,
.home-hero-content {
  position: relative;
  z-index: 1;
  width: min(100%, 56rem);
  margin-inline: max(0px, calc((100vw - 86rem) / 2));
}

.home-surface .page-heading {
  margin-bottom: var(--space-4);
}

.home-surface .page-heading h1 {
  max-width: 18ch;
  font-size: clamp(2.5rem, 6vw, 5.25rem);
}

.home-surface .page-heading::after {
  width: 5rem;
  background: var(--consumer-ink);
}

@media (max-width: 70rem) {
  .account-navigation {
    gap: var(--space-2);
  }

  .account-navigation > a {
    font-size: 0.78rem;
  }

  .language-switcher button {
    max-width: 5.5rem;
    white-space: normal;
  }
}

@media (max-width: 56rem) {
  :root {
    --header-height: 4rem;
  }

  body:has(.role-navigation) {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom));
  }

  .site-header {
    flex-wrap: wrap;
    padding-inline: var(--space-4);
  }

  .account-navigation {
    width: 100%;
    order: 3;
    overflow-x: auto;
    margin: 0;
    padding-bottom: var(--space-1);
    scrollbar-width: thin;
  }

  .brand-lockup {
    width: 100%;
    justify-content: space-between;
  }

  .owner-surface .site-header,
  .staff-surface .site-header {
    width: 100%;
    margin-left: 0;
  }

  .owner-surface .page-shell,
  .staff-surface .page-shell {
    width: min(100% - 2rem, 78rem);
    margin-inline: auto;
    padding: var(--space-6) 0;
  }

  .role-navigation--renter,
  .role-navigation--owner,
  .role-navigation--staff {
    position: fixed;
    inset: auto 0 0;
    z-index: 90;
    width: 100%;
    height: calc(4.75rem + env(safe-area-inset-bottom));
    flex-direction: row;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    padding: var(--space-1) var(--space-2) env(safe-area-inset-bottom);
    border: 0;
    border-top: 1px solid var(--color-border);
    background: rgb(255 255 255 / 98%);
    box-shadow: 0 -4px 16px rgb(0 0 0 / 6%);
    scrollbar-width: thin;
  }

  .role-navigation--owner .role-navigation__title,
  .role-navigation--staff .role-navigation__title,
  .role-navigation--renter .role-navigation__title {
    display: none;
  }

  .role-navigation--renter a,
  .role-navigation--owner a,
  .role-navigation--staff a {
    min-width: 5.75rem;
    min-height: 4.25rem;
    flex: 0 0 auto;
    justify-content: center;
    padding: var(--space-2);
    border: 0;
    border-top: 3px solid transparent;
    font-size: 0.72rem;
    text-align: center;
    white-space: normal;
  }

  .role-navigation--renter a:hover,
  .role-navigation--renter a:focus-visible,
  .role-navigation--owner a:hover,
  .role-navigation--owner a:focus-visible,
  .role-navigation--staff a:hover,
  .role-navigation--staff a:focus-visible {
    border-top-color: var(--action);
    border-bottom-color: transparent;
    background: color-mix(in srgb, var(--action) 7%, transparent);
  }

  .account-surface .site-header {
    position: relative;
    width: 100%;
    height: auto;
    padding: var(--space-4);
    background: #161616;
  }

  .account-surface .brand-lockup {
    width: 100%;
    flex-direction: row;
    align-items: baseline;
  }

  .account-surface .site-name {
    font-size: 1.6rem;
    font-weight: 600;
  }

  .account-surface .account-navigation {
    flex-wrap: nowrap;
  }

  .account-surface .page-shell {
    width: min(100% - 2rem, 42rem);
    min-height: auto;
    margin-inline: auto;
    padding: var(--space-10) 0 var(--space-16);
  }

  .home-surface .page-shell {
    min-height: 0;
    padding-top: var(--space-16);
    background:
      linear-gradient(rgb(248 249 250 / 92%), rgb(248 249 250 / 98%)),
      url("../img/flexivan-hero.svg") 65% 7rem / 48rem auto no-repeat,
      var(--consumer-background);
  }

  .home-surface .page-heading,
  .home-hero-content {
    margin-inline: 0;
  }
}

@media (max-width: 32rem) {
  .page-shell {
    width: min(100% - 1.5rem, 78rem);
  }

  .environment-label {
    font-size: 0.6rem;
  }

  .account-navigation > a,
  .language-switcher select,
  .language-switcher button {
    min-height: 2.75rem;
  }

  .home-surface .page-shell {
    padding-inline: var(--space-4);
  }
}
