:root {
  --bg: #0a0e14;
  --surface: #161b22;
  --surface-2: #1c222b;
  --card: rgba(22, 27, 34, .60);
  --border: rgba(42, 47, 56, .9);
  --border-strong: #2a2f38;
  --text: #f5f6f7;
  --text-muted: #8b92a0;
  --text-faint: #737b88;
  --accent: #ffb347;
  --accent-hover: #ffc064;
  --action-orange: #ff6a00;
  --action-gradient: linear-gradient(90deg, var(--action-orange), var(--accent));
  --action-gradient-hover: linear-gradient(90deg, #ff7a14, #ffc064);
  --blue: #0f62fe;
  --success: #34d399;
  --danger: #f87171;
  --on-accent: #0a0e14;
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: hidden; }
*:focus-visible { outline: 2px solid rgba(15, 98, 254, .9); outline-offset: 3px; }

.portal-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: minmax(0, 3fr) minmax(420px, 2fr);
  background: var(--bg);
}

.identity-panel {
  position: relative;
  isolation: isolate;
  display: flex;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(40px, 4.5vw, 64px);
  background:
    linear-gradient(90deg, rgba(5, 20, 36, .96) 0%, rgba(5, 20, 36, .82) 45%, rgba(5, 20, 36, .34) 100%),
    url('/assets/hero-hauling.png') 68% 62% / cover no-repeat;
}

.identity-panel::before {
  position: absolute;
  z-index: 0;
  right: -10%;
  bottom: -18%;
  width: 48%;
  height: 68%;
  border: 0;
  border-radius: 52% 0 0;
  background: linear-gradient(135deg, transparent 0 35%, rgba(5, 20, 36, .34) 36% 62%, rgba(5, 20, 36, .66) 63%);
  box-shadow: none;
  transform: skewX(-9deg);
  content: '';
  pointer-events: none;
}

.identity-panel::after {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2px;
  height: auto;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, transparent, rgba(148, 163, 184, .30) 20%, rgba(148, 163, 184, .12) 78%, transparent);
  box-shadow: none;
  transform: none;
  content: '';
  pointer-events: none;
}

.hero-brand, .hero-content, .hero-footer { position: relative; z-index: 1; }
.hero-brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: clamp(18px, 1.6vw, 22px); font-weight: 700; line-height: 1; }
.hero-brand span { color: var(--accent); font-size: clamp(38px, 3vw, 48px); font-weight: 400; line-height: .75; }
.hero-brand b { letter-spacing: .01em; text-transform: uppercase; }
.hero-content { width: min(100%, 760px); margin: auto 0; }
.identity-panel .kicker { margin: 0 0 16px; color: var(--accent); font-size: clamp(12px, 1vw, 14px); font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.identity-panel .brand { margin: 0; color: var(--text); font-size: clamp(44px, 4vw, 56px); font-weight: 750; letter-spacing: -.04em; line-height: 1; white-space: nowrap; }
.identity-panel h1 { max-width: 17ch; margin: 24px 0 18px; color: var(--text); font-size: clamp(34px, 3.1vw, 44px); font-weight: 650; line-height: 1.12; letter-spacing: -.035em; }
.identity-panel .lead { max-width: 54ch; margin: 0; color: #c4d3e0; font-size: clamp(14px, 1.25vw, 17px); line-height: 1.55; }
.identity-panel .access-grid { display: none; }
.hero-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; color: #c2d1dd; font-size: 12px; }
.hero-footer span { display: inline-flex; align-items: center; gap: 10px; }
.hero-footer i { display: inline-block; width: 30px; height: 4px; border-radius: 999px; background: var(--accent); }
.hero-footer b { color: #96a9ba; font-weight: 400; }

.login-panel {
  position: relative;
  isolation: isolate;
  display: flex;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 3vw, 48px);
  border-left: 0;
  background: var(--bg);
}

.login-panel::before {
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: -74px;
  width: 110px;
  background: linear-gradient(90deg, rgba(8, 26, 45, 0), rgba(8, 26, 45, .44) 40%, rgba(8, 26, 45, .86) 72%, var(--bg));
  clip-path: polygon(58% 0, 100% 0, 100% 100%, 45% 100%, 27% 88%, 17% 70%, 14% 51%, 22% 30%, 38% 11%);
  content: '';
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  color: var(--text);
  background: var(--card);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(10px);
}

.card-heading { display: flex; min-height: 36px; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.card-heading .status-dot { width: 8px; height: 8px; margin: 0; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 6px rgba(52, 211, 153, .10); }
.secure-label { padding: 8px 14px; border: 1px solid rgba(52, 211, 153, .30); border-radius: 999px; color: #6ee7b7; background: rgba(16, 185, 129, .10); font-size: 13px; font-weight: 600; letter-spacing: 0; }
.login-card .kicker { margin: 0 0 6px; color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.login-card h2 { margin: 0; font-size: clamp(28px, 2.3vw, 32px); font-weight: 650; line-height: 1.18; letter-spacing: -.02em; }
.login-card > p:not(.kicker) { max-width: 40ch; margin: 8px 0 0; color: #b8c9d9; font-size: 14px; line-height: 1.4; }
.login-card .error { color: var(--danger) !important; }

.auth-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 18px 0 12px; padding: 0; border: 1px solid var(--border-strong); border-radius: 12px; background: rgba(8, 26, 45, .72); }
.auth-tab { min-height: 50px; padding: 8px; border: 0; border-radius: 10px; color: var(--text-muted); background: transparent; font-size: 14px; font-weight: 600; cursor: pointer; }
.auth-tab small { display: block; margin-top: 2px; font-size: 9px; font-weight: 500; }
.auth-tab.active { color: #fff; background: linear-gradient(180deg, #1673e6, var(--blue)); box-shadow: 0 8px 18px rgba(15, 98, 254, .22); }
.auth-tab:disabled { cursor: not-allowed; color: var(--text-muted); opacity: .70; }
.auth-mode[hidden] { display: none !important; }
.auth-form { display: grid; gap: 12px; }
.auth-form label { display: grid; gap: 6px; color: var(--text); font-size: 13px; font-weight: 600; }
.auth-form input, .auth-form select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; outline: 0; color: var(--text); background: var(--surface-2); font: inherit; }
.auth-form input:focus, .auth-form select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(15, 98, 254, .20); }
.required { margin-left: 3px; color: var(--accent); }
.password-field { position: relative; display: flex; }
.password-field input { padding-right: 82px; }
.password-toggle { position: absolute; top: 4px; right: 4px; min-height: 38px; padding: 0 10px; border: 0; border-radius: 8px; color: var(--accent); background: transparent; font-size: 12px; font-weight: 600; }
.primary-button { display: flex; width: 100%; min-height: 46px; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; color: var(--on-accent); background: var(--accent); font-size: 14px; font-weight: 650; cursor: pointer; }
.primary-button:hover { background: var(--accent-hover); }
.primary-button:disabled { cursor: wait; opacity: .55; }
.text-button { display: block; margin: 10px 0 0 auto; padding: 4px 0; border: 0; color: var(--accent); background: transparent; font-size: 12px; }

.auth-mode[data-mode-panel="google"] { display: grid; width: 100%; min-width: 0; gap: 6px; }
.auth-mode[data-mode-panel="google"]::before { display: none; }
.google-intro { display: grid; width: min(100%, 400px); min-width: 0; grid-template-columns: 36px minmax(0, 1fr); align-items: center; justify-self: center; gap: 10px; padding: 10px 12px; border: 1px solid rgba(15, 23, 42, .08); border-radius: 14px; color: #102033; background: #fff; box-shadow: 0 8px 20px rgba(0, 0, 0, .12); text-align: left; cursor: pointer; }
.google-intro > .google-mark { display: grid !important; width: 34px; height: 34px; margin: 0 !important; padding: 0 !important; place-items: center; border-radius: 50%; color: #4285f4; background: transparent; font-size: 18px !important; font-weight: 800; line-height: 1 !important; }
.google-intro-copy { min-width: 0; }
.google-intro strong, .google-intro span { display: block; }
.google-intro strong { color: #102033; font-size: 14px; font-weight: 650; line-height: 1.2; }
.google-intro span { margin-top: 3px; color: #52657d; font-size: 11px; line-height: 1.3; }
.google-sign-in { display: none; width: min(100%, 400px); min-width: 0; min-height: 44px; align-items: center; justify-content: center; justify-self: center; margin: 0; padding: 2px 0; overflow: hidden; border: 0; background: transparent; }
.google-sign-in.revealed { display: flex; animation: google-account-reveal .18s ease-out; }
.google-intro.loading { cursor: wait; opacity: .78; }
.google-sign-in > div, .google-sign-in iframe { max-width: 100% !important; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 12px 0; color: var(--text-faint); font-size: 11px; }
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; background: var(--border); content: ''; }

.access-request { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-width: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: rgba(8, 26, 45, .58); }
.access-request > div { display: grid; min-width: 0; gap: 3px; }
.access-request strong { color: var(--text); font-size: 14px; font-weight: 600; }
.access-request span { color: #a8bbc9; font-size: 12px; }
.access-request #open-registration { width: auto; min-width: 124px; min-height: 40px; padding: 0 12px; border: 1px solid var(--accent); border-radius: 10px; color: var(--accent); background: transparent; font-size: 12px; font-weight: 600; white-space: nowrap; }
.access-request #open-registration:hover { background: rgba(245, 158, 11, .10); }
.browser-help { margin-top: 10px; padding: 9px 10px; border-radius: 9px; color: #ffd98b; background: rgba(47, 40, 22, .55); font-size: 11px; line-height: 1.4; }
.login-card footer { display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 11px; }
.login-card footer a { color: var(--accent); }
.login-card footer span { color: var(--text-faint); white-space: nowrap; }

@media (max-height: 800px) and (min-width: 1200px) {
  .identity-panel { padding-top: 28px; padding-bottom: 28px; }
  .hero-brand { font-size: 18px; }
  .identity-panel .brand { font-size: 44px; }
  .identity-panel h1 { margin: 18px 0 12px; font-size: 34px; }
  .identity-panel .lead { font-size: 14px; }
  .login-panel { padding: 24px 32px; }
  .login-card { padding: 22px 24px; }
  .card-heading { margin-bottom: 10px; padding-bottom: 9px; }
  .auth-switch { margin: 12px 0 8px; }
  .auth-divider { margin: 9px 0; }
  .login-card footer { margin-top: 9px; }
}

@media (max-width: 1199px) {
  html, body { width: 100%; min-width: 0; overflow-x: hidden; }
  .portal-shell { display: grid; width: 100%; min-width: 0; min-height: 100vh; min-height: 100dvh; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 20px; overflow-x: hidden; background: linear-gradient(180deg, rgba(5, 20, 36, .74), rgba(5, 20, 36, .90)), url('/assets/hero-hauling.png') 66% 58% / cover no-repeat; }
  .identity-panel { display: none !important; }
  .login-panel { position: static; display: grid; width: 100%; min-width: 0; max-width: none; min-height: 100%; padding: 0; border: 0; background: transparent; place-items: center; }
  .login-panel::before { display: none; }
  .login-card { width: min(100%, 520px); max-width: 520px; min-height: 0; margin: 0 auto; padding: 22px; border-radius: 18px; box-sizing: border-box; }
  .login-card, .auth-switch, .auth-mode, .google-intro, .google-sign-in, .access-request, .login-card footer { min-width: 0; max-width: 100%; box-sizing: border-box; }
  .login-card h2 { font-size: clamp(24px, 3.2vw, 28px); }
  .login-card > p:not(.kicker) { font-size: 13px; }
}

@media (max-width: 767px) {
  .portal-shell { display: grid; min-height: 100vh; min-height: 100dvh; padding: max(16px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom)); place-items: center; overflow-x: hidden; overflow-y: auto; background: linear-gradient(180deg, rgba(5, 20, 36, .76), rgba(5, 20, 36, .92)), url('/assets/hero-hauling.png') 70% 58% / cover no-repeat; }
  .login-panel { display: grid; width: 100%; min-height: auto; padding: 0; place-items: center; }
  .login-card { width: 100%; padding: 18px; border-radius: 16px; }
  .card-heading { min-height: 0; margin-bottom: 9px; padding-bottom: 8px; }
  .secure-label { padding: 6px 10px; font-size: 11px; }
  .login-card .kicker { font-size: 10px; }
  .login-card h2 { font-size: clamp(22px, 6vw, 24px); }
  .login-card > p:not(.kicker) { margin-top: 5px; font-size: 12px; }
  .auth-switch { margin: 12px 0 8px; }
  .auth-tab { min-height: 44px; font-size: 12px; }
  .google-intro { grid-template-columns: 34px minmax(0, 1fr); gap: 9px; padding: 9px 10px; }
  .google-intro > .google-mark { width: 32px; height: 32px; font-size: 17px !important; }
  .google-intro strong { font-size: 13px; }
  .google-intro span { font-size: 11px; line-height: 1.25; }
  .auth-divider { margin: 10px 0; }
  .access-request { gap: 10px; padding: 10px 12px; }
  .access-request #open-registration { min-width: 116px; }
  .login-card footer { margin-top: 10px; padding-top: 9px; font-size: 10px; }
}

@media (max-width: 430px) {
  .portal-shell { padding: 10px; }
  .login-card { padding: 16px; }
  .access-request { grid-template-columns: minmax(0, 1fr); }
  .access-request #open-registration { width: 100%; min-width: 0; }
  .login-card footer { grid-template-columns: 1fr 1fr; gap: 7px 10px; }
  .login-card footer span { grid-column: 1 / -1; }
}

@media (max-height: 720px) and (max-width: 1199px) {
  .portal-shell { align-items: start; overflow-y: auto; }
  .login-panel { min-height: 0; place-items: start center; }
  .login-card { margin: 0 auto; }
}

@media (max-width: 767px) and (min-height: 721px) {
  .login-card { margin: 0 auto; transform: translateY(clamp(-18px, -2vh, -8px)); }
}

@media (prefers-reduced-motion: reduce) {
  .primary-button { transition: none; }
  .google-sign-in.revealed { animation: none; }
}

@keyframes google-account-reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Compact login rhythm: preserve 44px controls while reducing non-action spacing. */
:root {
  --portal-space-xs: 6px;
  --portal-space-sm: 8px;
  --portal-space-md: 10px;
  --portal-space-lg: 14px;
}

.login-card { padding: 24px; border-radius: 20px; backdrop-filter: none; }
.card-heading { min-height: 30px; margin-bottom: 10px; padding-bottom: 10px; }
.login-card .kicker { margin-bottom: 4px; }
.login-card > p:not(.kicker) { margin-top: 6px; }
.auth-switch { margin: 14px 0 10px; }
.auth-tab { min-height: 46px; }
.auth-form, #registration-form { gap: var(--portal-space-md); margin-top: 0; }
.auth-form label, #registration-form label { gap: var(--portal-space-xs); }
.auth-form input, .auth-form select { min-height: 44px; padding: 9px 12px; }
.password-toggle { min-height: 36px; }
.primary-button { min-height: 46px; }
.text-button { margin-top: var(--portal-space-sm); }
.google-intro { padding: 9px 11px; }
.google-sign-in { min-height: 44px; padding: 0; }
.auth-divider { margin: var(--portal-space-sm) 0; }
.access-request { gap: var(--portal-space-sm); padding: 10px 12px; }
.access-request > div { gap: 2px; }
.access-request #open-registration { min-height: 38px; }
.browser-help { margin-top: var(--portal-space-sm); padding: 8px 10px; }
.login-card footer { margin-top: var(--portal-space-sm); padding-top: var(--portal-space-sm); }
.password-guidance { margin: -2px 0 0; }

@media (max-width: 1199px) {
  .portal-shell { padding: 16px; }
  .login-card { padding: 20px; }
}

@media (max-width: 767px) {
  .portal-shell { padding: 10px; }
  .login-card { padding: 16px; border-radius: 16px; }
  .card-heading { margin-bottom: 8px; padding-bottom: 8px; }
  .login-card h2 { font-size: clamp(22px, 6vw, 24px); }
  .login-card > p:not(.kicker) { margin-top: 4px; line-height: 1.45; }
  .auth-switch { margin: 10px 0 8px; }
  .auth-tab { min-height: 44px; }
  .auth-form, #registration-form { gap: 9px; }
  .auth-form input, .auth-form select { min-height: 44px; }
  .auth-divider { margin: 8px 0; }
  .access-request { padding: 9px 10px; }
  .login-card footer { margin-top: 8px; padding-top: 8px; }
}

@media (max-width: 430px) {
  .portal-shell { padding: 8px; }
  .login-card { padding: 14px; }
  .secure-label { padding: 5px 9px; }
  .access-request { grid-template-columns: minmax(0, 1fr); }
  .access-request #open-registration { width: 100%; min-height: 42px; }
}

/* Shared graphite base for login, registration, and account recovery states. */
.identity-panel {
  background:
    linear-gradient(90deg, rgba(10, 14, 20, .97) 0%, rgba(10, 14, 20, .84) 45%, rgba(10, 14, 20, .38) 100%),
    url('/assets/hero-hauling.png') 68% 62% / cover no-repeat;
}
.identity-panel::before { background: linear-gradient(135deg, transparent 0 35%, rgba(15, 19, 25, .38) 36% 62%, rgba(15, 19, 25, .72) 63%); }
.identity-panel::after { background: linear-gradient(180deg, transparent, rgba(139, 146, 160, .28) 20%, rgba(139, 146, 160, .12) 78%, transparent); }
.login-panel { background: var(--bg); }
.login-panel::before { background: linear-gradient(90deg, rgba(10, 14, 20, 0), rgba(15, 19, 25, .5) 40%, rgba(15, 19, 25, .88) 72%, var(--bg)); }
.login-card { border-color: var(--border-strong); background: var(--card); }
.auth-switch, .access-request { border-color: var(--border-strong); background: rgba(22, 27, 34, .60); }
.auth-form input, .auth-form select, #registration-form input, #registration-form select { border-color: var(--border-strong); color: var(--text); background: rgba(28, 34, 43, .60); }
.password-toggle { color: var(--accent); background: transparent; }
.login-card footer { border-color: var(--border); }
.primary-button, .registration-button {
  border-color: transparent;
  color: #17120c;
  background: var(--action-gradient);
  font-weight: 750;
}
.primary-button:hover, .primary-button:focus-visible,
.registration-button:hover, .registration-button:focus-visible {
  color: #17120c;
  background: var(--action-gradient-hover);
  box-shadow: 0 0 0 3px rgba(255, 179, 71, .15), 0 8px 22px rgba(255, 106, 0, .30);
  outline: 0;
}
.primary-button:active, .registration-button:active { background: linear-gradient(90deg, #e85f00, #efa13a); box-shadow: none; }
.primary-button:disabled, .registration-button:disabled { opacity: .52; box-shadow: none; }
@media (max-width: 1199px) {
  .portal-shell { background: linear-gradient(180deg, rgba(10, 14, 20, .76), rgba(10, 14, 20, .94)), url('/assets/hero-hauling.png') 66% 58% / cover no-repeat; }
}
@media (max-width: 767px) {
  .portal-shell { background: linear-gradient(180deg, rgba(10, 14, 20, .78), rgba(10, 14, 20, .96)), url('/assets/hero-hauling.png') 70% 58% / cover no-repeat; }
}
