/* ============================================================
   TRAPICO — Login Page Styles
   ============================================================ */

.login-page {
  height: 100vh;
  background: #000000;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.login-left {
  position: relative;
  overflow: hidden;
  background: #000000;
  color: #ffffff;
}

.login-left-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px 64px 56px;
  position: relative;
  z-index: 1;
}

.login-badge {
  width: fit-content;
  padding: 7px 14px;
  border-radius: 999px;
  background: #d72b3e;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 28px;
  box-shadow: 0 10px 24px rgba(170, 34, 34, 0.22);
}

.login-title {
  font-family: var(--font-head);
  font-size: clamp(72px, 8vw, 110px);
  line-height: 0.9;
  letter-spacing: -0.05em;
  font-weight: 800;
  margin-bottom: 18px;
}

.login-sub {
  max-width: 520px;
  color: #b0b0b0;
  font-size: 15px;
  line-height: 1.75;
  margin-bottom: 56px;
}

.login-stats {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.login-stat-block {
  min-width: 92px;
}

.login-stat-val {
  display: block;
  color: #ffffff;
  font-family: var(--font-head);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
}

.login-stat-label {
  display: block;
  margin-top: 6px;
  color: #6f6f6f;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.login-watermark {
  position: absolute;
  right: -74px;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: center;
  font-family: var(--font-head);
  font-size: clamp(120px, 16vw, 230px);
  font-weight: 800;
  color: #222222;
  letter-spacing: -0.05em;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

.login-right {
  position: relative;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 56px;
  overflow: hidden;
}

.login-panel {
  width: min(100%, 390px);
  position: relative;
}

.login-kicker {
  margin-bottom: 14px;
  color: #8a8a8a;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.login-form-title {
  margin-bottom: 28px;
  color: #111111;
  font-family: var(--font-head);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: center;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-field-group {
  gap: 8px;
}

.login-label {
  display: block;
  margin-bottom: 8px;
  color: #8a8a8a;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.login-input {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 46px;
  border: 1px solid #d6d9de;
  border-radius: 8px;
  background: #ededed;
  color: #111111;
  padding: 0 14px;
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.login-input::placeholder {
  color: #a2a2a2;
}

.login-input:focus {
  outline: none;
  border-color: #111111;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.07);
}

.password-wrap {
  position: relative;
}

.login-input-password {
  padding-right: 44px;
}

.password-toggle {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #666666;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.password-toggle:hover {
  color: #111111;
}

.login-actions-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -2px;
}

body[data-role="dispatch"] .forgot-inline-notif,
body[data-role="field"] .forgot-inline-notif,
body[data-role="regular"] .forgot-inline-notif {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #d72b3e;
  background: #fff1f3;
  color: #8d1021;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 600;
}

body[data-role="dispatch"] .forgot-inline-close,
body[data-role="field"] .forgot-inline-close,
body[data-role="regular"] .forgot-inline-close {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: #111111;
  font-size: 14px;
  cursor: pointer;
  padding: 0 2px;
}

/* ── DISPATCH SIGN-IN IMAGE MATCH ─────────────────────────── */
body[data-role="dispatch"] .login-page,
body[data-role="field"] .login-page,
body[data-role="regular"] .login-page {
  background: #000;
}

body[data-role="dispatch"] .login-left-inner,
body[data-role="field"] .login-left-inner,
body[data-role="regular"] .login-left-inner {
  padding: 70px 64px 56px;
}

body[data-role="dispatch"] .login-badge,
body[data-role="field"] .login-badge,
body[data-role="regular"] .login-badge {
  border-radius: 0;
  padding: 6px 14px;
  margin-bottom: 34px;
  box-shadow: none;
}

body[data-role="dispatch"] .login-title,
body[data-role="field"] .login-title,
body[data-role="regular"] .login-title {
  font-size: clamp(78px, 8.3vw, 116px);
  margin-bottom: 22px;
}

body[data-role="dispatch"] .login-sub,
body[data-role="field"] .login-sub,
body[data-role="regular"] .login-sub {
  max-width: 500px;
  color: #8f959f;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 58px;
}

body[data-role="dispatch"] .login-stat-val,
body[data-role="field"] .login-stat-val,
body[data-role="regular"] .login-stat-val {
  font-size: 44px;
}

body[data-role="dispatch"] .login-stat-label,
body[data-role="field"] .login-stat-label,
body[data-role="regular"] .login-stat-label {
  color: #8f959f;
}

body[data-role="dispatch"] .login-watermark,
body[data-role="field"] .login-watermark,
body[data-role="regular"] .login-watermark {
  left: 44px;
  right: auto;
  top: auto;
  bottom: -18px;
  transform: none;
  font-size: clamp(176px, 21vw, 280px);
  color: #0f1115;
}

body[data-role="dispatch"] .login-right,
body[data-role="field"] .login-right,
body[data-role="regular"] .login-right {
  background: #efefef;
  padding: 48px 64px;
}

body[data-role="dispatch"] .login-panel,
body[data-role="field"] .login-panel,
body[data-role="regular"] .login-panel {
  width: min(100%, 560px);
}

body[data-role="dispatch"] .login-kicker,
body[data-role="field"] .login-kicker,
body[data-role="regular"] .login-kicker {
  display: none;
}

body[data-role="dispatch"] .login-form-title,
body[data-role="field"] .login-form-title,
body[data-role="regular"] .login-form-title {
  margin-bottom: 20px;
  font-size: 42px;
  letter-spacing: -0.02em;
}

body[data-role="dispatch"] .login-form,
body[data-role="field"] .login-form,
body[data-role="regular"] .login-form {
  gap: 14px;
}

body[data-role="dispatch"] .login-label,
body[data-role="field"] .login-label,
body[data-role="regular"] .login-label {
  margin-bottom: 6px;
  color: #111;
  letter-spacing: 0.08em;
}

body[data-role="dispatch"] .login-input,
body[data-role="field"] .login-input,
body[data-role="regular"] .login-input {
  height: 46px;
  border-radius: 4px;
  border-color: #c8ccd1;
  background: #ededed;
}

body[data-role="dispatch"] .login-input:focus,
body[data-role="field"] .login-input:focus,
body[data-role="regular"] .login-input:focus {
  border-color: #9ea4ab;
  box-shadow: none;
}

body[data-role="dispatch"] .forgot-link,
body[data-role="field"] .forgot-link,
body[data-role="regular"] .forgot-link {
  color: #111;
}

body[data-role="dispatch"] .login-submit,
body[data-role="field"] .login-submit,
body[data-role="regular"] .login-submit {
  height: 48px;
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.12em;
}

body[data-role="dispatch"] .login-footer-copy,
body[data-role="field"] .login-footer-copy,
body[data-role="regular"] .login-footer-copy {
  margin-top: 6px;
  font-size: 12px;
}

body[data-role="dispatch"] .signup-link,
body[data-role="field"] .signup-link,
body[data-role="regular"] .signup-link {
  color: #111;
  font-weight: 700;
}

.forgot-link {
  color: #505050;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}

.forgot-link:hover {
  color: #111111;
  text-decoration: underline;
}

.login-error {
  border: 1px solid rgba(170, 34, 34, 0.28);
  background: #fff1f1;
  color: #aa2222;
  font-size: 13px;
  line-height: 1.45;
  padding: 11px 12px;
}

.login-submit {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 48px;
  margin-top: 4px;
  border: 0;
  background: #111111;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.login-submit:hover {
  background: #000000;
  transform: translateY(-1px);
  box-shadow: 0 16px 26px rgba(0, 0, 0, 0.16);
}

.auth-switch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.login-footer-copy {
  margin-top: 6px;
  text-align: center;
  color: #8a8a8a;
  font-size: 12px;
}

.signup-link {
  color: #1565c0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.login-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.login-modal-card {
  width: min(100%, 460px);
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.28);
}

.login-modal-title {
  margin: 0;
  font-family: var(--font-head);
  color: #111111;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
}

.login-modal-divider {
  border: 0;
  border-top: 2px solid #111111;
  margin: 14px 0;
}

.login-modal-body {
  margin: 0 0 18px;
  color: #404040;
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

.login-modal-close {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: #111111;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.login-modal-close:hover {
  background: #000000;
}

@media (forced-colors: active) {
  .login-input,
  .password-toggle,
  .login-submit,
  .login-modal-close {
    forced-color-adjust: none;
  }

  .login-input {
    background: #ededed;
    color: #111111;
    border: 1px solid #d6d9de;
  }

  .password-toggle {
    background: transparent;
    color: #666666;
    border: 0;
  }

  .login-submit,
  .login-modal-close {
    background: #111111;
    color: #ffffff;
    border: 0;
  }
}

@media (max-width: 760px) {
  .login-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr; /* header shrinks to content, form fills remaining space */
    height: auto;
    min-height: 100vh;
    overflow: visible;
    background: #000000;
  }

  .login-left { display: block; }

  .login-left-inner {
    min-height: auto !important;
    padding: 10px 18px !important;
  }

  /* Hide everything except badge + logo + title */
  .login-sub      { display: none !important; }
  .login-stats    { display: none !important; }
  .login-watermark{ display: none !important; }

  /* Badge: small pill above the logo row */
  .login-badge {
    display: inline-block !important;
    margin-bottom: 6px !important;
    font-size: 8px !important;
    padding: 4px 9px !important;
    border-radius: 4px !important;
  }

  /* Logo height = title font-size so they sit flush on the same baseline */
  .login-title { font-size: 20px !important; line-height: 1 !important; margin-bottom: 0 !important; letter-spacing: -0.02em !important; }
  .login-left img { height: 20px !important; }

  /* Form panel fills remaining viewport height */
  .login-right {
    align-items: flex-start;
    justify-content: center;
    padding: 32px 24px 48px !important;
    background: #efefef;
  }

  .login-panel { width: min(100%, 440px); }
}

@media (max-width: 560px) {
  .login-left-inner {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  .login-right {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  .login-stats { gap: 24px; }
  .login-form-title { font-size: 34px; }
  .login-modal-title { font-size: 24px; }
  /* Remember Me row: wrap on small phones */
  .login-actions-row { flex-wrap: wrap; gap: 8px 12px; }
}

@media (max-width: 400px) {
  .login-input { font-size: 16px !important; } /* prevent iOS zoom on focus */
  .login-submit { min-height: 50px; font-size: 14px; }
  .login-form-title { font-size: 30px; }
}