@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-wght.f6d31671339d.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f2f4f6;
  --text: #0f172a;
  --muted: #5c647a;
  --border: #e0e3e5;
  --primary: #d31219;
  --primary-strong: #a8000d;
  --accent: #0ea5e9;
  --accent-soft: #e0f2fe;
  --danger: #ba1a1a;
  --warning: #8a5a00;
  --success: #087f72;
  --focus: #0ea5e9;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(15, 23, 42, .06);
  font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { line-height: 1.6; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: var(--primary); text-decoration-thickness: .08em; text-underline-offset: .2em; }
a:hover { color: var(--primary-strong); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { outline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); }
.skip-link { position: fixed; inset-block-start: 8px; inset-inline-start: 8px; transform: translateY(-150%); background: var(--text); color: white; padding: .7rem 1rem; z-index: 1000; border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

.site-header { background: linear-gradient(120deg, #a8000d, #d31219 62%, #e8383e); color: white; box-shadow: 0 6px 24px rgba(168,0,13,.2); }
.header-inner, .primary-nav, .page-shell, .messages { width: min(1180px, calc(100% - 2rem)); margin-inline: auto; }
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { min-height: 44px; display: flex; align-items: center; gap: .75rem; color: white; text-decoration: none; }
.brand:hover { color: white; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; background: #fff; color: var(--primary); border-radius: 13px; box-shadow: 0 8px 20px rgba(75,0,6,.16); }
.brand-mark img { width: 70%; height: 70%; display: block; object-fit: contain; }
.brand strong, .brand small, .identity span, .identity small { display: block; }
.brand small, .identity small { opacity: .72; font-size: .75rem; direction: ltr; }
.identity { text-align: end; }
.organization-switcher { display: flex; align-items: center; gap: .45rem; margin-inline-start: auto; }
.organization-switcher label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.organization-switcher select { width: auto; min-width: 130px; min-height: 36px; background: rgba(109,8,18,.38); border-color: rgba(255,255,255,.42); color: white; }
.primary-nav { display: flex; align-items: stretch; gap: .2rem; overflow-x: auto; scrollbar-width: thin; }
.nav-group { display: contents; }
.primary-nav a, .nav-button { display: grid; place-items: center; min-height: 48px; padding: .55rem .85rem; color: #eaf5f3; background: transparent; border: 0; text-decoration: none; white-space: nowrap; cursor: pointer; }
.primary-nav a:hover, .nav-button:hover { background: rgba(255,255,255,.1); color: white; }
.nav-form { margin-inline-start: auto; display: flex; }
.sidebar-section-label, .workspace-topbar { display: none; }

.page-shell { padding-block: 2rem 4rem; min-height: calc(100vh - 170px); }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-block-end: 1.5rem; }
h1, h2, h3, p { margin-block-start: 0; }
h1 { margin-block-end: .35rem; font-size: clamp(1.65rem, 4vw, 2.45rem); line-height: 1.25; }
h2 { font-size: 1.12rem; }
.eyebrow { color: var(--primary); font-size: .8rem; font-weight: 800; letter-spacing: .04em; margin-block-end: .35rem; }
.muted, small { color: var(--muted); }
.messages { padding-block-start: 1rem; }
.message, .alert { padding: .8rem 1rem; border-radius: 10px; background: var(--surface); border-inline-start: 5px solid var(--primary); }
.message.error, .alert.error { border-color: var(--danger); }
.message.warning, .alert.warning { border-color: var(--warning); background: #fff9e8; }

.panel, .metric, .auth-panel, .empty-state, .notification, .danger-zone { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 1.15rem; min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-block-end: 1rem; }
.panel-heading h2 { margin: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-block-end: 1rem; }
.metric { padding: 1.15rem; border-block-start: 4px solid var(--primary); }
.metric span, .metric small { display: block; }
.metric strong { display: block; font-size: 2rem; margin-block: .25rem; }
.split-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 1rem; }
.single-panel-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
.inline-stats { display: flex; gap: 2rem; margin: 1rem 0 0; }
.inline-stats dt { color: var(--muted); font-size: .8rem; }
.inline-stats dd { margin: 0; font-weight: 800; font-size: 1.3rem; }
.activity-list, .recovery-grid { list-style: none; padding: 0; margin: 0; }
.activity-list li { display: flex; justify-content: space-between; gap: 1rem; padding-block: .8rem; border-block-end: 1px solid var(--border); }
.activity-list small { display: block; }

.status-pill { display: inline-flex; align-items: center; min-height: 28px; padding: .2rem .65rem; border-radius: 999px; background: var(--surface-soft); color: var(--text); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.status-pill.success, .status-pill.succeeded, .status-pill.approved { background: #daf2e5; color: #0c5231; }
.status-pill.denied, .status-pill.failed, .status-pill.error, .status-pill.rejected, .status-pill.critical { background: #f8dddd; color: #861e28; }
.status-pill.warning, .status-pill.queued, .status-pill.active { background: #fff0ca; color: #775000; }
.status-pill.running, .status-pill.info { background: #dcecff; color: #174f80; }

.table-wrap { overflow-x: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: .85rem .9rem; text-align: start; border-block-end: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); background: var(--surface-soft); font-size: .8rem; }
td small, td code { display: block; }
code { direction: ltr; unicode-bidi: isolate; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82em; overflow-wrap: anywhere; }

.filter-bar, .inline-form { display: flex; align-items: end; gap: .75rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-block-end: 1rem; }
.stacked-form { display: grid; gap: 1rem; }
.field { display: grid; gap: .3rem; min-width: 150px; }
.field.grow { flex: 1; }
label { font-size: .85rem; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 44px; border: 1px solid #cbd5e1; border-radius: 9px; background: var(--surface); color: var(--text); padding: .55rem .7rem; transition: border-color .18s ease, box-shadow .18s ease; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 4px rgba(14,165,233,.12); }
.ltr-field { direction: ltr; text-align: left; unicode-bidi: plaintext; }
textarea { min-height: 100px; resize: vertical; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 9px; padding: .55rem 1rem; text-decoration: none; cursor: pointer; font-weight: 700; }
.button.primary { background: var(--primary); color: white; }
.button.primary:hover { background: var(--primary-strong); color: white; }
.button.secondary { background: var(--surface-soft); color: var(--text); border-color: var(--border); }
.button.danger { background: var(--danger); color: white; }
.button.small { min-height: 36px; padding: .35rem .65rem; font-size: .82rem; }
.auth-panel { width: min(520px, 100%); margin: clamp(1rem, 8vh, 5rem) auto; padding: clamp(1.25rem, 5vw, 2.5rem); }
.security-note { margin-block: 1.4rem 0; color: var(--muted); font-size: .8rem; }
.security-note a { min-height: 44px; display: inline-flex; align-items: center; }
.steps { padding-inline-start: 1.5rem; }
.secret-box { display: grid; gap: .4rem; background: var(--surface-soft); padding: 1rem; border-radius: 10px; margin-block: 1rem; }
.wrap-code { display: block; white-space: normal; margin-block: .7rem; }
.recovery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .65rem; margin-block: 1.25rem; }
.recovery-grid li { padding: .65rem; text-align: center; background: var(--surface-soft); border-radius: 8px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-block: 1rem; }
.action-panel { margin-block-start: 1rem; }
.action-panel summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 800; }
.danger-zone { margin-block-start: 1rem; padding: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-color: #e3a8ad; }
.danger-zone p { margin: 0; color: var(--muted); }
.notification-list { display: grid; gap: .8rem; }
.notification { padding: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.notification.unread { border-inline-start: 5px solid var(--primary); }
.notification h2 { margin-block: .55rem .2rem; }
.empty-state { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.service-card { display: flex; flex-direction: column; }
.service-card .button { margin-block-start: auto; }
.service-card dd { overflow-wrap: anywhere; font-size: 1rem; }
.search-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-block-end: 1rem; }
.search-form .inline-form { padding: 0; border: 0; margin-block: .35rem; }
.search-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.setup-required { min-height: min(580px, calc(100dvh - 180px)); display: grid; grid-template-columns: minmax(220px,.75fr) minmax(300px,1.25fr); align-items: center; gap: clamp(2rem,6vw,5rem); overflow: hidden; padding: clamp(2rem,7vw,5.5rem); border: 1px solid #f0d9da; border-radius: 28px; background: radial-gradient(circle at 13% 20%, rgba(255,200,87,.2), transparent 18rem), radial-gradient(circle at 90% 85%, rgba(211,18,25,.1), transparent 24rem), #fff; box-shadow: 0 24px 70px rgba(32,38,58,.09); }
.setup-required-visual { position: relative; width: min(240px,60vw); aspect-ratio: 1; display: grid; place-items: center; justify-self: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg,#a8000d,#d31219 55%,#ff6b65); box-shadow: 0 28px 60px rgba(211,18,25,.28); }
.setup-required-visual strong { position: relative; z-index: 2; font-size: clamp(4rem,10vw,7rem); line-height: 1; }
.setup-required-orbit { position: absolute; inset: -22px; border: 2px dashed rgba(211,18,25,.22); border-radius: 50%; }
.setup-required-orbit::after { content: ""; position: absolute; width: 22px; height: 22px; inset-block-start: 17%; inset-inline-end: 1%; border-radius: 50%; background: #ffc857; box-shadow: 0 0 0 10px rgba(255,200,87,.18); }
.setup-required-copy { max-width: 590px; }
.setup-required-copy h1 { margin-block-end: 1rem; font-size: clamp(2rem,5vw,3.5rem); letter-spacing: -.035em; }
.setup-required-copy > p:not(.eyebrow) { max-width: 55ch; line-height: 2; }
.setup-required-copy .button { margin-block-start: .8rem; }
/* Employee-first dashboard */
.dashboard-page { background:
  radial-gradient(circle at 8% 18%, rgba(14,165,233,.1), transparent 25rem),
  radial-gradient(circle at 88% 42%, rgba(211,18,25,.07), transparent 24rem),
  var(--bg); }
.dashboard-page .page-shell { width: min(1240px, calc(100% - 2rem)); }
.dashboard-hero { position: relative; isolation: isolate; overflow: hidden; min-height: 255px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: clamp(1.6rem, 5vw, 3.6rem); margin-block-end: 2.3rem; border-radius: 24px; color: white; background: linear-gradient(125deg, #a8000d 0%, #d31219 52%, #e8383e 100%); box-shadow: 0 24px 60px rgba(168,0,13,.2); }
.dashboard-hero-copy { position: relative; z-index: 2; max-width: 650px; }
.dashboard-hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin-block-end: .75rem; letter-spacing: -.035em; }
.dashboard-hero p { margin: 0; color: rgba(255,255,255,.88); font-size: 1rem; }
.dashboard-hero .hero-kicker { display: inline-flex; margin-block-end: .75rem; padding: .3rem .7rem; border-radius: 999px; color: #0f172a; background: #e0f2fe; font-size: .78rem; font-weight: 850; }
.hero-summary { position: relative; z-index: 2; display: flex; gap: .75rem; flex-shrink: 0; }
.hero-summary a { min-width: 125px; padding: 1rem; text-align: center; color: white; text-decoration: none; border: 1px solid rgba(255,255,255,.26); border-radius: 20px; background: rgba(255,255,255,.13); backdrop-filter: blur(12px); }
.hero-summary strong, .hero-summary span { display: block; }
.hero-summary strong { font-size: 2rem; line-height: 1.2; }
.hero-summary span { color: rgba(255,255,255,.76); font-size: .76rem; }
.hero-shape { position: absolute; z-index: 1; border-radius: 50%; border: 28px solid rgba(255,255,255,.1); }
.hero-shape-one { width: 230px; height: 230px; inset-inline-end: -65px; inset-block-start: -95px; }
.hero-shape-two { width: 135px; height: 135px; inset-inline-start: 42%; inset-block-end: -90px; border-color: rgba(14,165,233,.28); }
.dashboard-section { margin-block-end: 2.4rem; }
.dashboard-section-heading, .dashboard-card-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-block-end: 1rem; }
.dashboard-section-heading h2 { margin: 0; font-size: clamp(1.45rem, 3vw, 2rem); }
.dashboard-section-heading > span { color: var(--muted); font-size: .82rem; }
.app-launcher { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
.app-card { --app-color: #d31219; --app-soft: #ffe8e6; position: relative; min-height: 138px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; padding: 1.2rem; overflow: hidden; color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 4px 20px rgba(15,23,42,.05); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.app-card::after { content: ""; position: absolute; width: 95px; height: 95px; inset-inline-end: -42px; inset-block-end: -50px; border-radius: 50%; background: var(--app-soft); }
.app-card:hover { color: var(--text); transform: translateY(-4px); border-color: var(--app-color); box-shadow: 0 18px 44px rgba(32,38,58,.12); }
.app-card .app-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; background: var(--app-soft); color: var(--app-color); font-size: 1.8rem; font-weight: 900; }
.app-card strong, .app-card small { display: block; }
.app-card strong { margin-block-end: .3rem; font-size: 1.05rem; }
.app-card small { color: var(--muted); }
.app-card > b { position: relative; z-index: 1; color: var(--app-color); font-size: 1.3rem; }
.app-card.app-sky { --app-color: #0e83bd; --app-soft: #e0f2fe; }
.app-card.app-yellow { --app-color: #9b6800; --app-soft: #fff4d6; }
.app-card.app-coral { --app-color: #d84f48; --app-soft: #ffebe9; }
.app-card.app-teal { --app-color: #078778; --app-soft: #def9f5; }
.app-card.app-rose { --app-color: #c52962; --app-soft: #ffe7f0; }
.dashboard-focus-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; margin-block-end: 1.5rem; }
.dashboard-card { padding: 1.25rem; background: var(--surface); border: 1px solid var(--border); border-block-start: 4px solid var(--primary); border-radius: 16px; box-shadow: 0 4px 20px rgba(15,23,42,.05); }
.dashboard-card-heading { align-items: center; }
.dashboard-card-heading h2, .dashboard-card-heading p { margin-block-end: 0; }
.dashboard-card-heading a { font-size: .8rem; font-weight: 750; }
.dashboard-list { list-style: none; padding: 0; margin: 0; }
.dashboard-list li { min-height: 70px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem; padding-block: .7rem; border-block-end: 1px solid var(--border); }
.dashboard-list li:last-child { border: 0; }
.dashboard-list strong, .dashboard-list small { display: block; }
.dashboard-list small { margin-block-start: .15rem; }
.list-mark { width: 11px; height: 38px; border-radius: 99px; background: #0ea5e9; }
.list-mark.yellow, .list-mark.warning { background: #ffc857; }
.list-mark.success { background: #2cc9b7; }.list-mark.critical { background: #d92d3a; }
.new-dot { width: 9px; height: 9px; border-radius: 50%; background: #d92d3a; box-shadow: 0 0 0 5px #fff0f1; }
.dashboard-empty > span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 15px; color: #087f72; background: #def9f5; font-size: 1.3rem; }
.technical-drawer { margin-block-start: 1rem; border: 1px dashed #e2bfc2; border-radius: 18px; background: rgba(255,255,255,.56); }
.technical-drawer summary { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; cursor: pointer; font-weight: 800; }
.technical-drawer summary small { font-weight: 500; }
.technical-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: .75rem; padding: 0 1rem 1rem; }
.technical-grid a { padding: 1rem; color: var(--text); text-decoration: none; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.technical-grid strong, .technical-grid span { display: block; }.technical-grid span { color: var(--muted); font-size: .76rem; margin-block-start: .2rem; }

/* Authenticated enterprise shell — RTL sidebar on desktop, compact navigation on mobile. */
@media (min-width: 901px) {
  .portal-authenticated .site-header {
    position: fixed;
    inset-block: 0;
    right: 0;
    left: auto;
    z-index: 30;
    width: 280px;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #0f172a;
    box-shadow: -10px 0 35px rgba(15,23,42,.12);
  }
  .portal-authenticated .header-inner {
    width: 100%;
    min-height: auto;
    display: block;
    padding: 1.5rem 1.35rem 1.25rem;
    border-block-end: 1px solid rgba(255,255,255,.09);
  }
  .portal-authenticated .brand { width: 100%; }
  .portal-authenticated .brand-mark { width: 48px; height: 48px; border-radius: 14px; }
  .portal-authenticated .brand strong { font-size: 1.08rem; }
  .portal-authenticated .brand small { margin-block-start: .15rem; color: #94a3b8; opacity: 1; direction: rtl; }
  .portal-authenticated .header-inner .identity { display: none; }
  .portal-authenticated .organization-switcher {
    width: 100%;
    margin: 1rem 0 0;
  }
  .portal-authenticated .organization-switcher select { flex: 1; min-width: 0; background: rgba(255,255,255,.07); }
  .portal-authenticated .primary-nav {
    width: 100%;
    min-height: 0;
    flex: 1;
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: .18rem;
    padding: 1rem .8rem;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-color: rgba(255,255,255,.22) transparent;
  }
  .portal-authenticated .sidebar-section-label {
    display: block;
    padding: .25rem .8rem .55rem;
    color: #64748b;
    font-size: .7rem;
    font-weight: 750;
  }
  .portal-authenticated .nav-group {
    display: flex;
    flex-direction: column;
    gap: .18rem;
    padding-block: .2rem .55rem;
  }
  .portal-authenticated .nav-group + .nav-group {
    margin-block-start: .2rem;
    padding-block-start: .7rem;
    border-block-start: 1px solid rgba(255,255,255,.06);
  }
  .portal-authenticated .primary-nav a,
  .portal-authenticated .nav-button {
    min-height: 44px;
    display: flex;
    justify-content: flex-start;
    padding: .62rem .85rem;
    border-radius: 9px;
    color: #cbd5e1;
  }
  .portal-authenticated .primary-nav a:hover,
  .portal-authenticated .nav-button:hover {
    color: #fff;
    background: rgba(211,18,25,.18);
  }
  .portal-authenticated .primary-nav a[aria-current="page"] { color: #fff; background: rgba(211,18,25,.2); box-shadow: inset -3px 0 #d31219; }
  .portal-authenticated .nav-form { width: 100%; margin: auto 0 0; border-block-start: 1px solid rgba(255,255,255,.08); padding-block-start: .65rem; }
  .portal-authenticated .nav-button { width: 100%; }
  .portal-authenticated .workspace-topbar {
    position: fixed;
    top: 0;
    right: 280px;
    left: 0;
    z-index: 25;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-inline: 32px;
    border-block-end: 1px solid rgba(15,23,42,.08);
    background: rgba(255,255,255,.82);
    box-shadow: 0 4px 18px rgba(15,23,42,.035);
    backdrop-filter: blur(12px);
  }
  .workspace-search { position: relative; width: min(390px, 45vw); }
  .workspace-search input { min-height: 44px; padding-inline: 1rem 3rem; border-color: transparent; border-radius: 999px; background: #f2f4f6; box-shadow: none; }
  .workspace-search button { position: absolute; inset-inline-end: .5rem; inset-block-start: 50%; width: 34px; height: 34px; translate: 0 -50%; border: 0; border-radius: 50%; color: #5c647a; background: transparent; cursor: pointer; font-size: 1.2rem; }
  .workspace-user { display: flex; align-items: center; gap: .7rem; }
  .workspace-user strong, .workspace-user small { display: block; }
  .workspace-user strong { font-size: .84rem; }
  .workspace-user small { font-size: .7rem; }
  .workspace-user-avatar { width: 40px; height: 40px; display: grid; place-items: center; border: 2px solid #fee2e2; border-radius: 50%; color: #fff; background: linear-gradient(145deg,#a8000d,#d31219); font-weight: 850; }
  .portal-authenticated .page-shell,
  .portal-authenticated.dashboard-page .page-shell {
    width: min(1240px, calc(100% - 344px));
    margin-right: 312px;
    margin-left: auto;
    padding-block: 104px 4rem;
  }
  .portal-authenticated .messages { width: min(1240px, calc(100% - 344px)); margin-right: 312px; margin-left: auto; padding-block-start: 88px; }
}

@media (max-width: 900px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .split-grid, .card-grid { grid-template-columns: 1fr; }
  .app-launcher { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-focus-grid { grid-template-columns: 1fr; }
  .dashboard-hero { align-items: flex-start; flex-direction: column; }
  .setup-required { min-height: 0; grid-template-columns: 1fr; text-align: center; }
  .setup-required-copy { justify-self: center; }
  .setup-required-copy > p { margin-inline: auto; }
  .setup-required-visual { width: min(170px,50vw); }
}

@media (max-width: 640px) {
  .header-inner, .primary-nav, .page-shell, .messages { width: min(100% - 1rem, 1180px); }
  .header-inner { min-height: 68px; }
  .brand small, .identity small { display: none; }
  .identity { max-width: 42%; font-size: .85rem; }
  .organization-switcher { display: none; }
  .primary-nav a, .nav-button { min-height: 46px; padding-inline: .65rem; }
  .button.small { min-height: 44px; }
  .page-shell { padding-block-start: 1.25rem; }
  .page-heading { align-items: start; flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: .65rem; }
  .metric { padding: .9rem; }
  .metric strong { font-size: 1.55rem; }
  .panel { padding: .85rem; }
  .table-wrap { overflow: visible; background: transparent; border: 0; box-shadow: none; }
  table, thead, tbody, tr, th, td { display: block; min-width: 0; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  tbody { display: grid; gap: .75rem; }
  tr { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .55rem; box-shadow: 0 5px 18px rgba(23,33,43,.05); }
  td { display: grid; grid-template-columns: minmax(95px, .7fr) 1.3fr; gap: .6rem; padding: .5rem; border: 0; }
  td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; font-weight: 700; }
  td[colspan] { display: block; text-align: center; }
  td[colspan]::before { display: none; }
  .inline-form, .filter-bar { align-items: stretch; flex-direction: column; }
  .field { width: 100%; }
  .recovery-grid { grid-template-columns: 1fr; }
  .notification, .danger-zone { align-items: stretch; flex-direction: column; }
  .dashboard-page .page-shell { width: min(100% - 1rem, 1240px); }
  .dashboard-hero { min-height: 280px; padding: 1.35rem; border-radius: 22px; }
  .dashboard-hero h1 { font-size: 2rem; }
  .hero-summary { width: 100%; }.hero-summary a { min-width: 0; flex: 1; }
  .app-launcher { grid-template-columns: 1fr; gap: .75rem; }
  .app-card { min-height: 108px; padding: 1rem; border-radius: 18px; }
  .app-card .app-icon { width: 50px; height: 50px; }
  .dashboard-section-heading > span { display: none; }
  .technical-grid { grid-template-columns: 1fr; }
}

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

@media (prefers-color-scheme: dark) {
  /* The enterprise workspace intentionally remains light for consistent density and legibility. */
  :root { color-scheme: light; }
}

/* Cinematic sign-in — all visual assets and fonts are served locally. */
.auth-page {
  color-scheme: dark;
  --auth-ink: #f7f3e9;
  --auth-muted: #a9b8b5;
  --auth-line: rgba(218, 181, 100, .19);
  --auth-gold: #d9b56a;
  --auth-green: #1e756b;
  background: #061311;
  color: var(--auth-ink);
  overflow-x: hidden;
}
.auth-page .site-header { display: none; }
.auth-page .page-shell { width: 100%; min-height: 100svh; padding: 0; }
.invoice-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.invoice-editor { max-width: 980px; margin-inline: auto; }
.user-editor { max-width: 900px; margin-inline: auto; }
.invoice-line-editor { border: 1px solid var(--line, #d9dde0); border-radius: 12px; padding: 1rem; margin: 0; }
.invoice-line-editor legend { padding-inline: .5rem; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
.mapping-grid { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: 1rem; }
.mapping-grid span { background: var(--surface-muted, #f4f5f6); border-radius: 999px; padding: .35rem .7rem; font-size: .78rem; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }
.auth-stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
  padding: 4rem 2rem 5.5rem;
  background:
    radial-gradient(circle at 78% 18%, rgba(32, 119, 106, .32), transparent 30%),
    radial-gradient(circle at 16% 84%, rgba(207, 164, 82, .12), transparent 27%),
    linear-gradient(128deg, #04100e 0%, #0a201d 48%, #071512 100%);
}
.auth-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  opacity: .18;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 86%);
}
.auth-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(2,9,8,.08), rgba(2,9,8,.72) 50%, rgba(2,9,8,.08));
  box-shadow: inset 0 0 180px 35px rgba(0,0,0,.45);
}
.auth-atmosphere, .auth-glow, .auth-orbit { position: absolute; pointer-events: none; }
.auth-atmosphere { inset: 0; z-index: -2; }
.auth-glow {
  width: 40rem;
  height: 40rem;
  inset-inline-start: -13rem;
  inset-block-start: -17rem;
  border-radius: 50%;
  background: rgba(215, 177, 101, .08);
  filter: blur(14px);
}
.auth-orbit { border: 1px solid rgba(218, 181, 106, .13); border-radius: 50%; }
.orbit-one { width: 46rem; height: 46rem; inset-inline-end: -23rem; inset-block-start: -20rem; }
.orbit-two { width: 28rem; height: 28rem; inset-inline-end: -14rem; inset-block-start: -11rem; }
.auth-shell {
  width: min(1160px, 100%);
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(390px, .88fr);
  overflow: hidden;
  border: 1px solid var(--auth-line);
  border-radius: 30px;
  background: rgba(7, 23, 20, .68);
  box-shadow: 0 38px 100px rgba(0,0,0,.48), inset 0 1px rgba(255,255,255,.04);
  backdrop-filter: blur(18px);
}
.auth-narrative {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 5vw, 4.5rem);
  overflow: hidden;
  border-inline-end: 1px solid var(--auth-line);
  background:
    linear-gradient(148deg, rgba(28, 99, 89, .42), rgba(4, 16, 14, .16) 53%),
    radial-gradient(circle at 40% 44%, rgba(216, 179, 105, .11), transparent 32%);
}
.auth-narrative::after {
  content: "ب";
  position: absolute;
  inset-inline-start: -1.5rem;
  inset-block-end: -10rem;
  color: rgba(216, 179, 105, .045);
  font-size: 34rem;
  font-weight: 900;
  line-height: 1;
}
.auth-brand { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .9rem; width: fit-content; color: white; text-decoration: none; }
.auth-brand:hover { color: white; }
.auth-brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(218,181,106,.55);
  border-radius: 16px;
  color: #10201d;
  background: linear-gradient(145deg, #f0d493, #b98b3d);
  box-shadow: 0 10px 30px rgba(205,158,73,.2);
  font-size: 1.6rem;
  font-weight: 900;
}
.auth-brand-mark img { width: 70%; height: 70%; display: block; object-fit: contain; }
.auth-brand strong { font-size: 1.15rem; }
.auth-brand small { margin-block-start: .15rem; color: rgba(255,255,255,.48); font-size: .61rem; letter-spacing: .13em; direction: ltr; }
.auth-narrative-copy { position: relative; z-index: 1; max-width: 580px; margin-block: auto; padding-block: 4rem; }
.auth-kicker { display: flex; align-items: center; gap: .7rem; color: var(--auth-gold); font-size: .8rem; font-weight: 650; letter-spacing: .04em; }
.auth-kicker span { width: 34px; height: 1px; background: currentColor; }
.auth-narrative h2 { max-width: 650px; margin-block: 1rem 1.4rem; font-size: clamp(2.7rem, 5vw, 5.1rem); font-weight: 800; line-height: 1.16; letter-spacing: -.055em; text-wrap: balance; }
.auth-narrative-copy > p:last-child { max-width: 570px; color: var(--auth-muted); font-size: 1rem; line-height: 2; }
.auth-trust-row { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: .8rem 1.3rem; color: rgba(223,234,231,.62); font-size: .72rem; }
.auth-trust-row span { display: inline-flex; align-items: center; gap: .45rem; }
.auth-trust-row i { width: 6px; height: 6px; border-radius: 50%; background: var(--auth-gold); box-shadow: 0 0 12px var(--auth-gold); }
.auth-page .auth-panel {
  width: auto;
  margin: 0;
  padding: clamp(2rem, 5vw, 4.25rem);
  align-self: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.auth-panel-heading { margin-block-end: 2.1rem; }
.auth-lock { position: relative; width: 42px; height: 38px; display: block; margin-block-end: 1.2rem; border: 1px solid rgba(218,181,106,.45); border-radius: 13px; background: rgba(218,181,106,.08); }
.auth-lock::before { content: ""; position: absolute; width: 14px; height: 11px; inset-inline-start: 50%; inset-block-start: 8px; translate: -50% -70%; border: 2px solid var(--auth-gold); border-block-end: 0; border-radius: 9px 9px 0 0; }
.auth-lock::after { content: ""; position: absolute; width: 4px; height: 8px; inset: 50% auto auto 50%; translate: -50% -35%; border-radius: 4px; background: var(--auth-gold); }
.auth-page .eyebrow { margin-block-end: .45rem; color: var(--auth-gold); letter-spacing: .06em; }
.auth-page .auth-panel h1 { margin: 0; color: #fff; font-size: clamp(1.7rem, 3vw, 2.35rem); letter-spacing: -.035em; }
.auth-panel-heading > p:last-child { margin-block: .55rem 0; color: var(--auth-muted); font-size: .84rem; }
.auth-form { gap: 1.15rem; }
.auth-page .field { gap: .5rem; }
.auth-page label { color: rgba(239,244,242,.82); font-size: .78rem; }
.auth-input-wrap { position: relative; }
.auth-input-wrap::before { content: ""; position: absolute; z-index: 1; inset-inline-start: 1rem; inset-block-start: 50%; width: 15px; height: 15px; translate: 0 -50%; opacity: .62; }
.username-icon::before { border: 1.5px solid #b9c7c3; border-radius: 50%; box-shadow: 0 9px 0 -3px #b9c7c3; translate: 0 -70%; }
.password-icon::before { width: 13px; height: 11px; border: 1.5px solid #b9c7c3; border-radius: 3px; }
.password-icon::after { content: ""; position: absolute; z-index: 1; inset-inline-start: 1.23rem; inset-block-start: calc(50% - 10px); width: 7px; height: 7px; border: 1.5px solid #b9c7c3; border-block-end: 0; border-radius: 6px 6px 0 0; }
.auth-page input {
  height: 55px;
  padding-inline: 3rem 1rem;
  border: 1px solid rgba(188, 208, 202, .2);
  border-radius: 13px;
  background: rgba(255,255,255,.055);
  color: white;
  caret-color: var(--auth-gold);
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.auth-page input::placeholder { color: rgba(211,224,220,.35); }
.auth-page input:hover { border-color: rgba(218,181,106,.4); background: rgba(255,255,255,.07); }
.auth-page input:focus { outline: 0; border-color: var(--auth-gold); background: rgba(255,255,255,.09); box-shadow: 0 0 0 4px rgba(218,181,106,.1); }
.auth-form-meta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: rgba(210,224,219,.5); font-size: .7rem; }
.auth-form-meta a { color: #d8be83; }
.auth-submit { width: 100%; height: 55px; justify-content: space-between; padding-inline: 1.35rem; border-radius: 13px; background: linear-gradient(105deg, #b88b43, #e2c47f 48%, #c49a52) !important; color: #13201d !important; box-shadow: 0 14px 35px rgba(191,146,68,.16); transition: transform .2s ease, box-shadow .2s ease, filter .2s ease; }
.auth-submit:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 18px 42px rgba(191,146,68,.25); }
.auth-submit b { font-size: 1.35rem; font-weight: 400; }
.auth-audit-note { display: flex; align-items: center; gap: .8rem; margin-block-start: 1.8rem; padding-block-start: 1.3rem; border-block-start: 1px solid rgba(255,255,255,.08); }
.auth-shield { width: 32px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; color: #9bd5ca; border: 1px solid rgba(98,190,173,.36); border-radius: 13px 13px 16px 16px; background: rgba(62,154,138,.08); font-size: .75rem; }
.auth-audit-note p, .auth-audit-note strong, .auth-audit-note small { display: block; margin: 0; }
.auth-audit-note strong { color: rgba(239,245,243,.8); font-size: .72rem; }
.auth-audit-note small { margin-block-start: .15rem; color: rgba(207,221,217,.45); font-size: .65rem; }
.auth-page .alert { margin-block-end: 1rem; background: rgba(255,255,255,.06); color: white; border: 1px solid rgba(255,255,255,.1); border-inline-start: 4px solid var(--danger); }
.auth-page .alert.warning { border-inline-start-color: var(--auth-gold); }
.auth-page .errorlist { margin: .25rem 0 0; padding: 0; list-style: none; color: #ffafb3; font-size: .72rem; }

@media (max-width: 920px) {
  .auth-stage { padding: 1rem 1rem 5rem; align-items: start; }
  .auth-shell { width: min(620px, 100%); min-height: 0; margin-block-start: 1rem; grid-template-columns: 1fr; border-radius: 24px; }
  .auth-narrative { min-height: 260px; padding: 1.6rem; border-inline-end: 0; border-block-end: 1px solid var(--auth-line); }
  .auth-narrative-copy { padding-block: 3rem 1rem; }
  .auth-narrative h2 { max-width: 470px; font-size: clamp(2.2rem, 9vw, 3.5rem); }
  .auth-narrative-copy > p:last-child { display: none; }
  .auth-trust-row { display: none; }
  .auth-page .auth-panel { padding: 2rem 1.6rem 2.4rem; }
  .auth-lock { display: none; }
}

@media (max-width: 520px) {
  .auth-stage { padding: .65rem .65rem 1rem; }
  .auth-shell { margin: 0; border-radius: 20px; }
  .auth-narrative { min-height: 225px; padding: 1.3rem; }
  .auth-brand-mark { width: 44px; height: 44px; border-radius: 13px; }
  .auth-narrative-copy { padding-block: 2.3rem .3rem; }
  .auth-narrative h2 { margin-block: .7rem 0; font-size: clamp(2rem, 10vw, 2.8rem); }
  .auth-page .auth-panel { padding: 1.7rem 1.2rem 2rem; }
  .auth-panel-heading { margin-block-end: 1.5rem; }
  .auth-page .auth-panel h1 { font-size: 1.55rem; }
  .auth-form-meta { align-items: flex-start; flex-direction: column; gap: .25rem; }
  .auth-audit-note small { line-height: 1.7; }
}

/* Standalone password recovery — never exposes Django's management UI. */
.reset-stage { min-height: 100vh; display: grid; place-items: center; padding: clamp(1rem, 4vw, 3rem); background: radial-gradient(circle at 15% 10%, #fff0c7, transparent 34%), radial-gradient(circle at 85% 85%, #ffe0e4, transparent 38%), #fff9f6; }
.auth-page .reset-card { width: min(520px, 100%); padding: clamp(1.5rem, 5vw, 3rem); border: 1px solid rgba(217,45,58,.13); border-radius: 28px; background: rgba(255,255,255,.96); box-shadow: 0 28px 80px rgba(91,39,44,.13); color: #20263a; }
.reset-card h1 { margin: .35rem 0 .7rem; color: #20263a; font-size: clamp(1.75rem, 5vw, 2.35rem); }
.reset-lead, .reset-privacy { color: #687086; line-height: 1.9; }
.reset-feedback { min-height: 2.5rem; display: flex; align-items: center; }
.reset-methods { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 0 0 1rem; padding: 0; border: 0; }
.reset-methods legend { grid-column: 1 / -1; margin-bottom: .4rem; color: #353c51; font-weight: 700; }
.reset-method { position: relative; cursor: pointer; }
.reset-method input { position: absolute; opacity: 0; pointer-events: none; }
.reset-method span { display: grid; place-items: center; min-height: 52px; border: 1px solid #e7dadd; border-radius: 15px; background: #fff; font-weight: 750; transition: .2s ease; }
.reset-method input:checked + span { border-color: #d92d3a; color: #b51d29; background: #fff1f2; box-shadow: 0 0 0 3px rgba(217,45,58,.08); }
.reset-card .auth-submit { width: 100%; justify-content: center; }
.reset-code { direction: ltr; text-align: center; letter-spacing: .55em; font-size: 1.3rem; font-weight: 800; }
.reset-privacy { margin: 1.2rem 0 .6rem; font-size: .82rem; }
.reset-back { display: inline-block; color: #d92d3a; font-weight: 700; }
.reset-resend { margin-top: 1rem; }
.reset-resend p { margin: .55rem 0 0; color: #687086; font-size: .84rem; }
.reset-back.is-locked { color: #9b9daa; cursor: not-allowed; pointer-events: none; text-decoration: none; }
.reset-success { text-align: center; }
.reset-success-mark { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 1rem; border-radius: 50%; color: #fff; background: #087f72; font-size: 2rem; }

/* Joyful Borsa brand theme. See DESIGN_SYSTEM.md for the governing palette. */
.auth-page {
  color-scheme: light;
  --auth-ink: #20263a;
  --auth-muted: #687086;
  --auth-line: rgba(217, 45, 58, .13);
  --auth-gold: #d92d3a;
  --auth-green: #2cc9b7;
  background: #fff9f2;
  color: var(--auth-ink);
}
.auth-stage {
  background:
    radial-gradient(circle at 85% 14%, rgba(255, 200, 87, .55), transparent 24%),
    radial-gradient(circle at 11% 88%, rgba(70, 189, 235, .34), transparent 25%),
    radial-gradient(circle at 44% 48%, rgba(255, 122, 114, .2), transparent 31%),
    linear-gradient(135deg, #fff9f2 0%, #fff0f1 52%, #fffaf0 100%);
}
.auth-stage::before {
  opacity: .48;
  background-image:
    linear-gradient(rgba(217,45,58,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217,45,58,.045) 1px, transparent 1px);
}
.auth-stage::after {
  background: linear-gradient(90deg, rgba(255,255,255,.02), rgba(255,255,255,.35) 50%, rgba(255,255,255,.02));
  box-shadow: inset 0 0 170px 25px rgba(255,255,255,.3);
}
.auth-glow { background: rgba(255, 122, 114, .2); }
.auth-orbit { border-color: rgba(217, 45, 58, .15); }
.auth-shell {
  border-color: rgba(217, 45, 58, .14);
  background: rgba(255,255,255,.78);
  box-shadow: 0 38px 100px rgba(173, 63, 71, .16), inset 0 1px rgba(255,255,255,.9);
}
.auth-narrative {
  border-color: rgba(255,255,255,.3);
  background:
    radial-gradient(circle at 12% 88%, rgba(255,200,87,.52), transparent 26%),
    radial-gradient(circle at 88% 18%, rgba(70,189,235,.25), transparent 23%),
    linear-gradient(145deg, #d92d3a 0%, #f04452 47%, #ff7a72 100%);
}
.auth-narrative::before {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  inset-inline-end: -55px;
  inset-block-start: 32%;
  border-radius: 45% 55% 62% 38%;
  background: rgba(255,200,87,.22);
  rotate: 22deg;
}
.auth-narrative::after { color: rgba(255,255,255,.075); }
.auth-brand-mark {
  border-color: rgba(255,255,255,.62);
  color: #d92d3a;
  background: #fff;
  box-shadow: 0 12px 30px rgba(121, 24, 31, .18);
}
.auth-brand small { color: rgba(255,255,255,.72); }
.auth-kicker { color: #fff3c8; }
.auth-narrative-copy > p:last-child { color: rgba(255,255,255,.82); }
.auth-trust-row { color: rgba(255,255,255,.82); }
.auth-trust-row i { background: #ffc857; box-shadow: 0 0 12px rgba(255,200,87,.8); }
.auth-page .auth-panel { color: #20263a; }
.auth-lock { border-color: rgba(217,45,58,.22); background: #fff0f1; }
.auth-lock::before { border-color: #d92d3a; }
.auth-lock::after { background: #d92d3a; }
.auth-page .eyebrow { color: #d92d3a; }
.auth-page .auth-panel h1 { color: #20263a; }
.auth-panel-heading > p:last-child { color: #687086; }
.auth-feedback {
  min-height: 3.4rem;
  display: flex;
  align-items: flex-start;
  margin-block-start: .55rem;
  color: #687086;
  font-size: .84rem;
}
.auth-feedback p { margin: 0; }
.auth-feedback-message { color: #a71520; font-weight: 650; line-height: 1.8; }
.auth-feedback-message.success { color: #087f72; }
.auth-feedback-message.warning { color: #8a5a00; }
.auth-page label { color: #353c51; }
.username-icon::before { border-color: #7b8296; box-shadow: 0 9px 0 -3px #7b8296; }
.password-icon::before, .password-icon::after { border-color: #7b8296; }
.auth-page input {
  border-color: #e2d8d8;
  background: #fff;
  color: #20263a;
  caret-color: #d92d3a;
  box-shadow: 0 8px 24px rgba(55, 43, 49, .045);
}
.auth-page input::placeholder { color: #a8a6af; }
.auth-page input:hover { border-color: rgba(217,45,58,.45); background: #fffafa; }
.auth-page input:focus { border-color: #f04452; background: #fff; box-shadow: 0 0 0 4px rgba(240,68,82,.11), 0 10px 26px rgba(217,45,58,.08); }
.auth-form-meta { color: #8a8fa0; }
.auth-form-meta a { color: #d92d3a; font-weight: 700; }
.auth-submit {
  background: linear-gradient(105deg, #d92d3a, #f04452 52%, #ff6b65) !important;
  color: #fff !important;
  box-shadow: 0 15px 34px rgba(217,45,58,.24);
}
.auth-submit:hover { box-shadow: 0 19px 42px rgba(217,45,58,.32); }
.auth-audit-note { border-color: #eee5e3; }
.auth-shield { color: #087f72; border-color: rgba(44,201,183,.32); background: rgba(44,201,183,.12); }
.auth-audit-note strong { color: #394054; }
.auth-audit-note small { color: #858b9a; }
.auth-page .alert { background: #fff; color: #20263a; border-color: #f0d9da; }
.auth-page .errorlist { color: #a71520; }
/* Human, cinematic login composition. */
.auth-shell { min-height: 680px; }
.auth-narrative {
  isolation: isolate;
  background-image: url("../img/login-people-v2.3f7afd1d398e.webp");
  background-position: 50% center;
  background-size: cover;
}
.auth-slides { position: absolute; z-index: -2; inset: 0; overflow: hidden; background: #5f2028; }
.auth-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 1s cubic-bezier(.22,.61,.36,1), visibility 1s; }
.auth-slide.is-active { opacity: 1; visibility: visible; z-index: 2; }
.auth-slide.is-leaving { visibility: visible; z-index: 1; }
.auth-slide img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% center; transform: scale(1.035); transition: transform 4.8s cubic-bezier(.2,.65,.3,1); }
.auth-slide.is-active img { transform: scale(1.095); }
.auth-slide-copy { position: absolute; z-index: 2; inset-inline: clamp(1.3rem, 5vw, 4rem); inset-block-end: clamp(1.5rem, 6vw, 4rem); max-width: 600px; color: #fff; text-shadow: 0 4px 30px rgba(0,0,0,.48); transform: translateY(22px); opacity: 0; transition: transform .9s .18s cubic-bezier(.22,.61,.36,1), opacity .8s .18s ease; }
.auth-slide.is-active .auth-slide-copy { transform: translateY(0); opacity: 1; }
.auth-slide-copy h2 { margin: 0; }
.auth-slide-copy p { max-width: 520px; margin: .8rem 0 0; color: rgba(255,255,255,.9); font-size: 1rem; line-height: 1.9; }
.transition-fade .auth-slide img { transform: scale(1.02); }.transition-fade .auth-slide.is-active img { transform: scale(1.02); }
.transition-slide .auth-slide { opacity: 1; transform: translateX(-100%); transition: transform 1s cubic-bezier(.65,0,.35,1), visibility 1s; }
.transition-slide .auth-slide.is-active { transform: translateX(0); }.transition-slide .auth-slide.is-leaving { transform: translateX(100%); }
.auth-narrative::before {
  z-index: -1;
  width: auto;
  height: auto;
  inset: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(22,20,27,.16) 0%, transparent 34%, rgba(25,20,25,.03) 50%, rgba(26,19,22,.68) 100%),
    linear-gradient(90deg, rgba(217,45,58,.16), transparent 54%);
  rotate: 0deg;
}
.auth-narrative::after { display: none; }
.auth-brand { text-shadow: 0 2px 18px rgba(0,0,0,.32); }
.auth-narrative-copy {
  margin-block: auto 0;
  padding-block: 5rem 0;
}
.auth-narrative h2 {
  max-width: 570px;
  margin: 0;
  color: #fff;
  font-size: clamp(2.8rem, 5vw, 5rem);
  line-height: 1.12;
  text-shadow: 0 4px 30px rgba(0,0,0,.36);
}
.auth-form-meta { justify-content: flex-end; }
.auth-page .auth-panel { padding-block: clamp(3rem, 7vw, 5rem); }

@media (max-width: 920px) {
  .auth-shell { min-height: 0; }
  .auth-narrative {
    min-height: 330px;
    background-position: 50% 38%;
  }
  .auth-slide img { object-position: 50% 38%; }
  .auth-narrative-copy { padding-block: 5rem 0; }
  .auth-narrative h2 { font-size: clamp(2.2rem, 9vw, 3.5rem); }
}

@media (max-width: 520px) {
  .auth-narrative {
    min-height: 285px;
    background-position: 50% 42%;
  }
  .auth-slide img { object-position: 50% 42%; }
  .auth-slide-copy { inset-inline: 1.3rem; inset-block-end: 1.2rem; }
  .auth-slide-copy p { display: none; }
  .auth-narrative-copy { padding-block: 3rem 0; }
  .auth-narrative h2 { max-width: 260px; font-size: 2.25rem; }
}

/* Auth pages share one cinematic frame; desktop sign-in stays locked to the viewport. */
@media (min-width: 921px) {
  body.auth-page { height: 100dvh; min-height: 0; overflow: hidden; }
  .auth-page .page-shell { height: 100dvh; min-height: 0; }
  .auth-stage {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    padding: clamp(.75rem, 2vh, 1.5rem) 2rem;
  }
  .auth-shell {
    height: min(680px, calc(100dvh - clamp(1.5rem, 4vh, 3rem)));
    min-height: 0;
    max-height: 680px;
  }
}

.auth-flow-shell { min-height: 620px; }
.auth-flow-narrative { background-position: 48% center; }
.auth-flow-narrative .auth-slide-copy h2 { font-size: clamp(2.5rem, 4vw, 4.2rem); }
.auth-flow-panel { display: flex; align-items: center; }
.auth-page .auth-flow-panel { padding: 2rem clamp(2rem, 4vw, 3.25rem); }
.auth-flow-panel > * { width: 100%; }
.auth-flow-panel .reset-card {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.auth-flow-panel h1,
.auth-flow-panel .reset-card h1 {
  margin: .35rem 0 .65rem;
  color: #20263a;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  letter-spacing: -.035em;
}
.auth-flow-lead,
.auth-flow-panel .reset-lead,
.auth-flow-panel .reset-privacy {
  color: #687086;
  line-height: 1.9;
}
.auth-flow-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-block-end: 1.1rem;
  border: 1px solid rgba(217,45,58,.16);
  border-radius: 17px;
  color: #d92d3a;
  background: linear-gradient(145deg, #fff, #fff0f1);
  box-shadow: 0 12px 28px rgba(217,45,58,.1);
  font-size: 1.25rem;
  font-weight: 850;
}
.auth-flow-panel .stacked-form { margin-block-start: 1.1rem; }
.auth-flow-panel .inline-form { justify-content: center; margin-block-start: .85rem; }
.auth-text-button {
  padding: .35rem .7rem;
  border: 0;
  color: #d92d3a;
  background: transparent;
  font: inherit;
  font-size: .82rem;
  font-weight: 750;
  cursor: pointer;
}
.auth-text-button:hover { color: #a71520; }
.auth-flow-panel .reset-method span { box-shadow: 0 8px 24px rgba(55,43,49,.04); }
.auth-flow-panel .reset-success-mark {
  background: linear-gradient(145deg, #18a997, #2cc9b7);
  box-shadow: 0 14px 32px rgba(44,201,183,.24);
}

@media (min-width: 921px) {
  .auth-flow-shell {
    height: min(700px, calc(100dvh - clamp(1.5rem, 4vh, 3rem)));
    max-height: 700px;
  }
}

@media (max-width: 920px) {
  body.auth-page { overflow-x: hidden; overflow-y: auto; }
  .auth-page .page-shell { height: auto; }
  .auth-flow-stage { min-height: 100svh; }
  .auth-flow-narrative { min-height: 280px; }
}

@media (max-width: 520px) {
  .auth-flow-narrative { min-height: 230px; }
  .auth-flow-narrative .auth-slide-copy h2 { font-size: 2rem; }
  .auth-flow-panel .reset-privacy { font-size: .76rem; }
}
