:root {
  color-scheme: light;
  --red: #d60821;
  --red-dark: #ad071a;
  --ink: #171b1f;
  --ink-soft: #30373c;
  --paper: #ffffff;
  --surface: #f3f5f4;
  --line: #d8ddda;
  --muted: #626c71;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--ink);
}

body {
  min-height: 100svh;
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 9px 13px;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.portal-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100svh;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  background-image: url("/assets/courier-partner-hero.jpg");
  background-position: center;
  background-size: cover;
}

.portal-shell::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: rgba(10, 14, 16, 0.7);
  content: "";
}

.portal-header,
.portal-content,
.portal-footer {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.portal-header {
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 15px;
  font-weight: 750;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 205px;
  height: auto;
}

.brand span {
  padding-left: 13px;
  border-left: 1px solid rgba(255, 255, 255, 0.45);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.back-link {
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover {
  color: var(--paper);
  text-decoration: underline;
}

.language-select {
  min-width: 68px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  padding: 0 30px 0 12px;
  background: rgba(20, 24, 27, 0.68);
  color: var(--paper);
  font-size: 14px;
  font-weight: 700;
}

.portal-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: clamp(48px, 8vw, 112px);
  align-items: center;
  padding-top: 56px;
  padding-bottom: 56px;
}

.portal-intro {
  max-width: 610px;
}

.eyebrow,
.panel-label {
  margin: 0 0 14px;
  color: #f3c46f;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.portal-intro h1 {
  max-width: 600px;
  margin: 0 0 22px;
  font-size: 52px;
  font-weight: 800;
  line-height: 1.08;
}

.portal-intro > p:last-child {
  max-width: 580px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 19px;
}

.login-panel {
  border-radius: 8px;
  padding: 34px;
  background: var(--paper);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.28);
  color: var(--ink);
}

.login-heading {
  margin-bottom: 24px;
}

.panel-label {
  margin-bottom: 8px;
  color: var(--red);
}

.login-heading h2 {
  margin: 0 0 10px;
  font-size: 32px;
  line-height: 1.15;
}

.login-heading p:last-child {
  margin: 0;
  color: var(--muted);
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 720;
}

.field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #c7ceca;
  border-radius: 6px;
  padding: 9px 12px;
  background: var(--paper);
  color: var(--ink);
}

.field input:focus {
  border-color: var(--ink);
  outline: 3px solid rgba(243, 196, 111, 0.48);
  outline-offset: 1px;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 92px;
}

.password-toggle {
  position: absolute;
  top: 4px;
  right: 4px;
  min-height: 38px;
  border: 0;
  border-radius: 4px;
  padding: 7px 10px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.password-toggle:hover {
  background: #e7eae8;
}

.login-button {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  padding: 11px 18px;
  background: var(--red);
  color: var(--paper);
  cursor: pointer;
  font-weight: 780;
}

.login-button:hover {
  background: var(--red-dark);
}

.login-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.login-status {
  margin: 0 0 16px;
  border-left: 3px solid #d49b32;
  padding: 7px 0 7px 12px;
  color: var(--muted);
  font-size: 13px;
}

.login-status.is-active {
  color: var(--ink-soft);
  font-weight: 650;
}

.portal-footer {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.portal-footer a {
  text-decoration: none;
}

.portal-footer a:hover {
  color: var(--paper);
}

:focus-visible {
  outline: 3px solid #f3c46f;
  outline-offset: 3px;
}

@media (max-width: 820px) {
  .portal-shell {
    overflow: visible;
  }

  .portal-content {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-top: 42px;
    padding-bottom: 46px;
  }

  .portal-intro h1 {
    font-size: 42px;
  }

  .portal-intro > p:last-child {
    font-size: 17px;
  }

  .login-panel {
    width: min(100%, 520px);
  }
}

@media (max-width: 600px) {
  .portal-header,
  .portal-content,
  .portal-footer {
    width: calc(100% - 32px);
  }

  .portal-header {
    min-height: 76px;
  }

  .brand img {
    width: 150px;
  }

  .brand span,
  .back-link {
    display: none;
  }

  .portal-content {
    padding-top: 34px;
  }

  .portal-intro h1 {
    font-size: 36px;
  }

  .login-panel {
    padding: 26px 20px;
  }

  .portal-footer {
    min-height: 72px;
  }
}

@media (max-width: 360px) {
  .brand img {
    width: 136px;
  }

  .language-select {
    min-width: 62px;
  }

  .portal-intro h1 {
    font-size: 33px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
