:root {
  --login-bg: #020712;
  --panel-bg: rgba(2, 8, 23, 0.88);
  --panel-bg-strong: rgba(2, 8, 23, 0.96);
  --panel-border: rgba(148, 163, 184, 0.24);
  --panel-border-strong: rgba(148, 163, 184, 0.36);
  --text-main: #f8fafc;
  --text-muted: #aab6c8;
  --text-dim: #74839a;
  --accent: #2f8cff;
  --accent-strong: #1f63e9;
  --accent-soft: rgba(47, 140, 255, 0.16);
  --accent-border: rgba(47, 140, 255, 0.36);
  --button-text: #ffffff;
  --support: #10d979;
  --support-soft: rgba(16, 217, 121, 0.1);
  --support-border: rgba(16, 217, 121, 0.28);
  --warning: #f5a623;
}

body.portal-admin {
  --accent: #f5a623;
  --accent-strong: #d88b14;
  --accent-soft: rgba(245, 166, 35, 0.15);
  --accent-border: rgba(245, 166, 35, 0.34);
  --button-text: #1a1205;
}

body.portal-approver {
  --accent: #19c98a;
  --accent-strong: #059669;
  --accent-soft: rgba(25, 201, 138, 0.14);
  --accent-border: rgba(25, 201, 138, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body.login-shell-body {
  min-height: 100vh;
  background: var(--login-bg);
  color: var(--text-main);
  font-family: Inter, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

.login-page {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(420px, 0.86fr);
  min-height: 100vh;
  min-height: 100svh;
  isolation: isolate;
  overflow: hidden;
  background-image: url("/uploads/excavator.jpeg");
  background-position: center center;
  background-size: cover;
}

.login-page::before,
.login-page::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.login-page::before {
  background:
    linear-gradient(90deg, rgba(2, 6, 15, 0.26) 0%, rgba(2, 6, 15, 0.34) 46%, rgba(2, 6, 15, 0.68) 100%),
    linear-gradient(180deg, rgba(2, 6, 15, 0.04) 0%, rgba(2, 6, 15, 0.64) 100%);
}

.login-page::after {
  background:
    radial-gradient(circle at 34% 44%, rgba(255, 190, 71, 0.05), transparent 34%),
    linear-gradient(180deg, transparent 0%, rgba(2, 7, 18, 0.58) 88%);
}

.brand-column,
.auth-column {
  position: relative;
  z-index: 1;
}

.brand-column {
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  flex-direction: column;
  justify-content: space-between;
  padding: 54px 64px 36px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 30px;
  min-width: 0;
}

.brand-logo-frame {
  display: inline-flex;
  flex: 0 0 auto;
  width: clamp(226px, 15.6vw, 282px);
  height: clamp(82px, 5.6vw, 102px);
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 0;
  background: transparent;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.44));
}

.brand-logo-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.brand-divider {
  width: 1px;
  height: 72px;
  margin-left: 2px;
  background: linear-gradient(180deg, transparent, rgba(226, 232, 240, 0.5), transparent);
}

.brand-name {
  font-family: Outfit, Inter, sans-serif;
  font-size: clamp(24px, 1.65vw, 32px);
  font-weight: 800;
  line-height: 1.05;
  color: #ffffff;
  white-space: nowrap;
}

.brand-content {
  max-width: 690px;
  margin: auto 0;
  padding: 52px 0 36px;
}

.portal-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  padding: 5px 11px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.brand-title {
  margin: 28px 0 0;
  color: #ffffff;
  font-family: Outfit, Inter, sans-serif;
  font-size: 50px;
  font-weight: 800;
  line-height: 1.08;
}

.brand-title .accent-line {
  display: block;
  color: var(--accent);
  text-shadow: 0 0 30px color-mix(in srgb, var(--accent) 32%, transparent);
}

.brand-copy {
  max-width: 620px;
  margin: 22px 0 0;
  color: #d4deea;
  font-size: 17px;
  line-height: 1.62;
}

.feature-grid {
  display: grid;
  max-width: 590px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 32px;
}

.feature-tile {
  display: flex;
  min-height: 104px;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.54);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.feature-icon {
  display: inline-flex;
  width: 52px;
  min-width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 22px;
}

.feature-tile.support-feature .feature-icon {
  background: var(--support-soft);
  color: var(--support);
}

.feature-title {
  margin: 0;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}

.feature-copy {
  margin: 5px 0 0;
  color: #c1ccdb;
  font-size: 14px;
  line-height: 1.35;
}

.brand-footer {
  color: #9aa8ba;
  font-size: 13px;
}

.brand-footer strong {
  color: var(--warning);
}

.auth-column {
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  align-items: center;
  justify-content: center;
  padding: 18px 18px 18px 0;
}

.auth-panel {
  width: min(100%, 620px);
  max-height: calc(100vh - 36px);
  max-height: calc(100svh - 36px);
  overflow-y: auto;
  padding: 58px 56px 42px;
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(3, 11, 26, 0.95), rgba(2, 8, 23, 0.88)),
    var(--panel-bg);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.38) transparent;
}

.auth-panel::-webkit-scrollbar {
  width: 8px;
}

.auth-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.32);
}

.mobile-lockup {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.mobile-lockup img {
  width: 132px;
  height: auto;
}

.mobile-lockup span {
  color: #ffffff;
  font-family: Outfit, Inter, sans-serif;
  font-size: 16px;
  font-weight: 800;
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-title {
  margin: 0;
  color: #ffffff;
  font-family: Outfit, Inter, sans-serif;
  font-size: 38px;
  font-weight: 800;
  line-height: 1.08;
}

.auth-subtitle {
  max-width: 410px;
  margin: 14px 0 34px;
  color: #d2dbea;
  font-size: 16px;
  line-height: 1.55;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.flash-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(248, 113, 113, 0.38);
  border-radius: 12px;
  background: rgba(127, 29, 29, 0.2);
  color: #fecaca;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.auth-form {
  display: grid;
  gap: 24px;
}

.field-label {
  display: block;
  margin: 0 0 11px;
  color: #d7dfeb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-control {
  position: relative;
}

.field-icon,
.field-action,
.field-chevron {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.field-icon {
  left: 18px;
  color: #8290a5;
  font-size: 17px;
  pointer-events: none;
}

.field-chevron {
  right: 18px;
  color: #9aa8ba;
  font-size: 13px;
  pointer-events: none;
}

.login-input {
  width: 100%;
  height: 60px;
  padding: 0 18px 0 54px;
  border: 1px solid var(--panel-border-strong);
  border-radius: 14px;
  outline: none;
  background: rgba(5, 14, 31, 0.62);
  color: #ffffff;
  font-size: 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

select.login-input {
  padding-right: 46px;
  appearance: none;
  cursor: pointer;
}

.login-input::placeholder {
  color: #6f7d92;
  opacity: 1;
}

.login-input:focus {
  border-color: var(--accent);
  background: rgba(7, 18, 39, 0.78);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}

option {
  background: #07111f;
  color: #f8fafc;
}

.field-action {
  right: 10px;
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #8290a5;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.field-action:hover,
.field-action:focus-visible {
  background: rgba(148, 163, 184, 0.1);
  color: #ffffff;
}

.primary-action {
  display: inline-flex;
  width: 100%;
  min-height: 60px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 1px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--button-text);
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 22%, transparent);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.primary-action:hover,
.primary-action:focus-visible {
  filter: brightness(1.08);
  box-shadow: 0 18px 42px color-mix(in srgb, var(--accent) 30%, transparent);
  transform: translateY(-1px);
}

.primary-action:active {
  transform: translateY(1px);
}

.support-card,
.portal-switch {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px;
  background: rgba(8, 17, 34, 0.64);
}

.support-card {
  display: grid;
  gap: 14px;
  margin-top: 26px;
  padding: 18px;
  text-align: center;
}

.support-card p {
  margin: 0;
  color: #ffbf32;
  font-size: 13px;
  font-weight: 800;
}

.whatsapp-action {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--support-border);
  border-radius: 12px;
  background: var(--support-soft);
  color: var(--support);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.whatsapp-action:hover,
.whatsapp-action:focus-visible {
  border-color: rgba(16, 217, 121, 0.52);
  background: rgba(16, 217, 121, 0.16);
  transform: translateY(-1px);
}

.portal-switch {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
  padding: 13px;
}

.portal-switch a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  border-radius: 10px;
  color: #b9c5d7;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.portal-switch a:hover,
.portal-switch a:focus-visible {
  background: rgba(148, 163, 184, 0.1);
  color: var(--accent);
}

.auth-footer {
  display: none;
}

body.login-shell-body #cookie-consent-banner {
  right: 24px !important;
  bottom: 22px !important;
  left: auto !important;
  max-width: 520px;
}

body.login-shell-body #cookie-consent-banner > div {
  max-width: 100% !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
  border-radius: 18px !important;
  background: rgba(7, 16, 32, 0.94) !important;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.48) !important;
}

@media (min-width: 1400px) {
  .brand-column {
    padding-left: 64px;
  }

  .brand-title {
    font-size: 56px;
  }
}

@media (max-width: 1160px) {
  .login-page {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 0.9fr);
  }

  .brand-column {
    padding: 38px 34px 30px;
  }

  .brand-logo-frame {
    width: 232px;
    height: 84px;
  }

  .brand-name {
    font-size: 22px;
  }

  .brand-title {
    font-size: 42px;
  }

  .auth-panel {
    padding: 46px 36px 34px;
  }
}

@media (max-width: 900px) {
  .login-page {
    display: block;
    min-height: 100vh;
    min-height: 100svh;
    background-position: center top;
    overflow: auto;
  }

  .login-page::before {
    background:
      linear-gradient(180deg, rgba(2, 6, 15, 0.24) 0%, rgba(2, 6, 15, 0.58) 44%, rgba(2, 7, 18, 0.88) 100%),
      linear-gradient(90deg, rgba(2, 6, 15, 0.38), rgba(2, 6, 15, 0.52));
  }

  .brand-column {
    min-height: auto;
    padding: max(24px, env(safe-area-inset-top)) 20px 8px;
  }

  .brand-lockup {
    gap: 14px;
  }

  .brand-logo-frame {
    width: 168px;
    height: 60px;
  }

  .brand-divider {
    height: 46px;
  }

  .brand-name {
    font-size: 18px;
    white-space: normal;
  }

  .brand-content {
    max-width: 520px;
    padding: 48px 0 18px;
  }

  .brand-title {
    margin-top: 18px;
    font-size: 36px;
  }

  .brand-copy {
    margin-top: 16px;
    font-size: 15px;
    line-height: 1.55;
  }

  .feature-grid,
  .brand-footer {
    display: none;
  }

  .auth-column {
    min-height: auto;
    padding: 8px 18px max(28px, env(safe-area-inset-bottom));
  }

  .auth-panel {
    max-height: none;
    padding: 26px 18px 22px;
    border-radius: 18px;
  }

  .auth-kicker {
    margin-bottom: 12px;
  }

  .auth-title {
    font-size: 30px;
  }

  .auth-subtitle {
    margin-bottom: 26px;
    font-size: 15px;
  }

  .auth-form {
    gap: 20px;
  }

  .login-input,
  .primary-action {
    min-height: 56px;
    height: 56px;
  }

  .portal-switch {
    flex-direction: column;
  }

  body.login-shell-body #cookie-consent-banner {
    position: static !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    max-width: none;
    margin: 18px 14px max(16px, env(safe-area-inset-bottom)) !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (min-width: 901px) and (max-height: 980px) {
  .auth-panel {
    padding-top: 42px;
    padding-bottom: 30px;
  }

  .auth-subtitle {
    margin-bottom: 26px;
  }

  .auth-form {
    gap: 18px;
  }

  .field-label {
    margin-bottom: 8px;
  }

  .login-input,
  .primary-action {
    min-height: 54px;
    height: 54px;
  }

  .support-card {
    gap: 10px;
    margin-top: 18px;
    padding: 13px;
  }

  .whatsapp-action {
    min-height: 42px;
  }

  body.login-shell-body #cookie-consent-banner > div {
    gap: 8px !important;
    padding: 12px 14px !important;
    border-radius: 14px !important;
  }

  body.login-shell-body #cookie-consent-banner > div > p {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .brand-column {
    padding-left: 16px;
    padding-right: 16px;
  }

  .brand-logo-frame {
    width: 136px;
    height: 49px;
  }

  .brand-divider {
    height: 42px;
    margin-left: 0;
  }

  .brand-name {
    font-size: 16px;
  }

  .brand-title {
    font-size: 32px;
  }

  .auth-column {
    padding-left: 12px;
    padding-right: 12px;
  }

  .auth-panel {
    padding-left: 14px;
    padding-right: 14px;
  }

  .field-label {
    font-size: 11px;
  }

  .support-card {
    padding: 14px;
  }
}
