/* ============================================================
   PBCPA CONTROL ROOM LOGIN
   ============================================================ */

:root {
  --black: #070707;
  --black-soft: #0d0d0d;
  --panel: #111111;
  --panel-light: #171717;

  --red: #c9141e;
  --red-bright: #e31b27;
  --red-dark: #8e0d14;

  --white: #ffffff;
  --off-white: #f5f5f5;

  --grey-100: #eeeeee;
  --grey-200: #d8d8d8;
  --grey-300: #b8b8b8;
  --grey-400: #8f8f8f;
  --grey-500: #686868;
  --grey-600: #454545;
  --grey-700: #2a2a2a;

  --success: #28a745;
  --warning: #e3a008;
  --danger: #d52b35;

  --border: rgba(255, 255, 255, 0.1);

  --shadow:
    0 24px 70px rgba(0, 0, 0, 0.28);

  --radius: 18px;
}


/* ============================================================
   RESET
   ============================================================ */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--black);
}

body {
  min-height: 100vh;
  margin: 0;

  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  color: #202020;
  background: var(--off-white);

  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}


/* ============================================================
   MAIN PAGE
   ============================================================ */

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns:
    minmax(380px, 0.9fr)
    minmax(500px, 1.1fr);
}


/* ============================================================
   BRAND PANEL
   ============================================================ */

.brand-panel {
  position: relative;
  overflow: hidden;

  min-height: 100vh;

  display: flex;
  align-items: center;

  color: var(--white);

  background:
    radial-gradient(
      circle at 20% 15%,
      rgba(201, 20, 30, 0.25),
      transparent 28%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(201, 20, 30, 0.12),
      transparent 34%
    ),
    linear-gradient(
      145deg,
      #151515 0%,
      #080808 48%,
      #000000 100%
    );
}

.brand-panel::before {
  content: "";

  position: absolute;
  inset: 0;

  opacity: 0.17;

  background-image:
    linear-gradient(
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px
    );

  background-size: 44px 44px;
}

.brand-panel::after {
  content: "";

  position: absolute;

  width: 420px;
  height: 420px;

  right: -230px;
  top: 12%;

  border-radius: 50%;
  border:
    80px solid
    rgba(201, 20, 30, 0.05);
}

.brand-overlay {
  position: absolute;
  inset: 0;

  pointer-events: none;

  background:
    linear-gradient(
      90deg,
      transparent 0%,
      transparent 75%,
      rgba(255, 255, 255, 0.025) 100%
    );
}

.brand-content {
  position: relative;
  z-index: 2;

  width: 100%;
  max-width: 640px;

  padding:
    60px
    clamp(40px, 6vw, 90px);
}

.brand-logo-link {
  display: inline-flex;
  align-items: center;

  margin-bottom: 28px;
}

.brand-logo {
  display: block;

  width: 112px;
  height: 112px;

  object-fit: contain;

  filter:
    drop-shadow(
      0 12px 20px
      rgba(0, 0, 0, 0.5)
    );
}

.brand-heading {
  margin-bottom: 28px;
}

.brand-kicker {
  display: block;

  margin-bottom: 6px;

  color: var(--red-bright);

  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand-heading h1 {
  margin: 0;

  color: var(--white);

  font-size:
    clamp(3.2rem, 6vw, 5.4rem);

  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.brand-name {
  max-width: 440px;

  margin:
    14px
    0
    0;

  color: var(--grey-300);

  font-size: 1rem;
  line-height: 1.5;
}

.control-room-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;

  margin:
    4px
    0
    22px;

  padding:
    10px
    14px;

  border:
    1px solid
    rgba(227, 27, 39, 0.35);

  border-radius: 999px;

  color: #ffffff;

  background:
    rgba(201, 20, 30, 0.09);

  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.status-dot {
  width: 8px;
  height: 8px;

  border-radius: 50%;

  background: var(--red-bright);

  box-shadow:
    0 0 0 5px
    rgba(227, 27, 39, 0.12);
}

.brand-description {
  max-width: 500px;

  margin:
    0
    0
    36px;

  color: #d0d0d0;

  font-size: 1rem;
  line-height: 1.7;
}

.brand-features {
  display: grid;
  gap: 8px;

  max-width: 520px;
}

.brand-feature {
  display: grid;
  grid-template-columns:
    38px
    minmax(0, 1fr);

  gap: 15px;

  padding:
    15px
    0;

  border-bottom:
    1px solid
    rgba(255, 255, 255, 0.08);
}

.feature-number {
  padding-top: 2px;

  color: var(--red-bright);

  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.brand-feature strong {
  display: block;

  margin-bottom: 4px;

  color: var(--white);

  font-size: 0.9rem;
}

.brand-feature div span {
  display: block;

  color: var(--grey-400);

  font-size: 0.82rem;
  line-height: 1.5;
}

.brand-footer {
  margin-top: 40px;

  color: var(--grey-500);

  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}


/* ============================================================
   ACCESS PANEL
   ============================================================ */

.access-panel {
  min-height: 100vh;

  display: flex;
  align-items: center;
  justify-content: center;

  padding:
    48px
    clamp(28px, 6vw, 88px);

  background:
    linear-gradient(
      180deg,
      #ffffff 0%,
      #f5f5f5 100%
    );
}

.access-inner {
  width: 100%;
  max-width: 540px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  margin-bottom: 24px;

  color: #666666;

  font-size: 0.82rem;
  font-weight: 700;

  transition:
    color 0.18s ease,
    transform 0.18s ease;
}

.back-link:hover {
  color: var(--red);
  transform: translateX(-2px);
}


/* ============================================================
   SYSTEM STATUS
   ============================================================ */

.system-status {
  display: flex;
  align-items: center;
  gap: 9px;

  margin-bottom: 12px;

  color: #737373;

  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.system-status-dot {
  width: 8px;
  height: 8px;

  flex: 0 0 auto;

  border-radius: 50%;
}

.system-status-dot.checking {
  background: var(--warning);

  animation:
    statusPulse 1.3s
    ease-in-out infinite;
}

.system-status-dot.online {
  background: var(--success);

  box-shadow:
    0 0 0 4px
    rgba(40, 167, 69, 0.1);
}

.system-status-dot.offline {
  background: var(--danger);

  box-shadow:
    0 0 0 4px
    rgba(213, 43, 53, 0.1);
}

@keyframes statusPulse {
  0%,
  100% {
    opacity: 0.45;
  }

  50% {
    opacity: 1;
  }
}


/* ============================================================
   AUTH CARD
   ============================================================ */

.auth-card {
  position: relative;

  width: 100%;

  padding:
    clamp(28px, 4vw, 42px);

  overflow: hidden;

  border:
    1px solid
    #e5e5e5;

  border-radius: var(--radius);

  background: #ffffff;

  box-shadow: var(--shadow);
}

.auth-card::before {
  content: "";

  position: absolute;
  top: 0;
  left: 0;

  width: 100%;
  height: 4px;

  background:
    linear-gradient(
      90deg,
      var(--red-dark),
      var(--red-bright)
    );
}

.auth-heading {
  margin-bottom: 28px;
}

.auth-eyebrow {
  display: block;

  margin-bottom: 8px;

  color: var(--red);

  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.auth-heading h2,
.connection-error h2 {
  margin:
    0
    0
    8px;

  color: #111111;

  font-size:
    clamp(1.8rem, 4vw, 2.35rem);

  line-height: 1.1;
  letter-spacing: -0.035em;
}

.auth-heading p,
.connection-error p {
  margin: 0;

  color: #747474;

  font-size: 0.91rem;
  line-height: 1.6;
}


/* ============================================================
   SETUP ALERT
   ============================================================ */

.setup-alert {
  margin:
    -8px
    0
    30px;

  padding:
    18px
    20px;

  border:
    1px solid
    rgba(201, 20, 30, 0.16);

  border-left:
    4px solid
    var(--red);

  border-radius: 10px;

  background:
    rgba(201, 20, 30, 0.04);
}

.setup-alert-label {
  display: block;

  margin-bottom: 7px;

  color: var(--red);

  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.setup-alert strong {
  display: block;

  margin-bottom: 5px;

  color: #171717;

  font-size: 0.94rem;
}

.setup-alert p {
  margin: 0;

  color: #6f6f6f;

  font-size: 0.82rem;
  line-height: 1.55;
}


/* ============================================================
   FORM
   ============================================================ */

.field-group {
  margin-bottom: 19px;
}

.field-group label {
  display: block;

  margin-bottom: 7px;

  color: #292929;

  font-size: 0.78rem;
  font-weight: 800;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 15px;
}

.field-label-row label {
  margin-bottom: 7px;
}

.text-button {
  margin-bottom: 7px;
  padding: 0;

  border: 0;

  color: var(--red);

  background: transparent;

  font-size: 0.72rem;
  font-weight: 800;
}

.text-button:hover {
  text-decoration: underline;
}

input {
  width: 100%;
  height: 50px;

  padding:
    0
    14px;

  border:
    1px solid
    #d8d8d8;

  border-radius: 9px;

  outline: none;

  color: #181818;
  background: #fafafa;

  font-size: 0.9rem;

  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

input::placeholder {
  color: #a2a2a2;
}

input:hover {
  border-color: #c1c1c1;
}

input:focus {
  border-color: var(--red);

  background: #ffffff;

  box-shadow:
    0 0 0 3px
    rgba(201, 20, 30, 0.08);
}

input.input-error {
  border-color: var(--danger);

  box-shadow:
    0 0 0 3px
    rgba(213, 43, 53, 0.07);
}

.credential-input-wrap {
  position: relative;
}

.field-help {
  margin:
    7px
    0
    0;

  color: #8a8a8a;

  font-size: 0.71rem;
  line-height: 1.45;
}

.form-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 14px;
}


/* ============================================================
   BUTTON
   ============================================================ */

.primary-button {
  position: relative;

  width: 100%;
  min-height: 52px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-top: 5px;
  padding:
    12px
    20px;

  border: 0;
  border-radius: 9px;

  color: #ffffff;

  background:
    linear-gradient(
      135deg,
      var(--red-bright),
      var(--red-dark)
    );

  box-shadow:
    0 9px 22px
    rgba(201, 20, 30, 0.2);

  font-size: 0.83rem;
  font-weight: 900;
  letter-spacing: 0.025em;

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);

  box-shadow:
    0 12px 26px
    rgba(201, 20, 30, 0.26);
}

.primary-button:active:not(:disabled) {
  transform: translateY(0);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.button-loader {
  display: none;

  width: 17px;
  height: 17px;

  border:
    2px solid
    rgba(255, 255, 255, 0.35);

  border-top-color: #ffffff;

  border-radius: 50%;

  animation:
    buttonSpin 0.7s
    linear infinite;
}

.primary-button.loading .button-text {
  display: none;
}

.primary-button.loading .button-loader {
  display: block;
}

@keyframes buttonSpin {
  to {
    transform: rotate(360deg);
  }
}


/* ============================================================
   MESSAGES
   ============================================================ */

.message-box {
  margin-bottom: 20px;

  padding:
    12px
    14px;

  border-radius: 8px;

  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.5;
}

.message-box.error {
  border:
    1px solid
    rgba(213, 43, 53, 0.22);

  color: #9e1e27;

  background:
    rgba(213, 43, 53, 0.06);
}

.message-box.success {
  border:
    1px solid
    rgba(40, 167, 69, 0.22);

  color: #237938;

  background:
    rgba(40, 167, 69, 0.07);
}

.message-box.warning {
  border:
    1px solid
    rgba(227, 160, 8, 0.25);

  color: #8b6509;

  background:
    rgba(227, 160, 8, 0.08);
}


/* ============================================================
   SECURITY NOTICE
   ============================================================ */

.security-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;

  margin-top: 22px;
  padding-top: 19px;

  border-top:
    1px solid
    #ededed;
}

.security-icon {
  color: var(--red);

  font-size: 0.95rem;
  line-height: 1.3;
}

.security-notice p {
  margin: 0;

  color: #8a8a8a;

  font-size: 0.7rem;
  line-height: 1.5;
}


/* ============================================================
   SIGNED-IN USER
   ============================================================ */

.signed-in-user {
  display: grid;
  gap: 3px;

  margin-bottom: 24px;

  padding:
    14px
    16px;

  border:
    1px solid
    #e5e5e5;

  border-radius: 9px;

  background: #f8f8f8;
}

.signed-in-label {
  color: #8a8a8a;

  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.signed-in-user strong {
  color: #1b1b1b;

  font-size: 0.9rem;
}

.signed-in-user > span:last-child {
  color: var(--red);

  font-size: 0.7rem;
  font-weight: 800;
}


/* ============================================================
   CONNECTION ERROR
   ============================================================ */

.connection-error {
  text-align: center;
}

.connection-symbol {
  width: 54px;
  height: 54px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin:
    0
    auto
    20px;

  border:
    1px solid
    rgba(201, 20, 30, 0.22);

  border-radius: 50%;

  color: var(--red);

  background:
    rgba(201, 20, 30, 0.06);

  font-size: 1.4rem;
  font-weight: 900;
}

.connection-error .primary-button {
  margin-top: 24px;
}


/* ============================================================
   ACCESS FOOTER
   ============================================================ */

.access-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;

  gap: 8px;

  margin-top: 22px;

  color: #999999;

  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.footer-divider {
  color: var(--red);
}


/* ============================================================
   NOSCRIPT
   ============================================================ */

.noscript-warning {
  position: fixed;

  left: 20px;
  right: 20px;
  bottom: 20px;

  z-index: 1000;

  padding: 15px;

  border-radius: 8px;

  color: #ffffff;
  background: var(--red);

  text-align: center;

  font-size: 0.85rem;
  font-weight: 800;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 980px) {

  .page-shell {
    grid-template-columns:
      340px
      minmax(0, 1fr);
  }

  .brand-content {
    padding:
      50px
      35px;
  }

  .brand-logo {
    width: 90px;
    height: 90px;
  }

  .brand-heading h1 {
    font-size: 3.4rem;
  }

  .brand-features {
    display: none;
  }

  .brand-description {
    margin-bottom: 20px;
  }

}


@media (max-width: 760px) {

  .page-shell {
    display: block;
  }

  .brand-panel {
    min-height: auto;
  }

  .brand-content {
    max-width: none;

    padding:
      26px
      24px
      28px;
  }

  .brand-logo-link {
    margin-bottom: 15px;
  }

  .brand-logo {
    width: 70px;
    height: 70px;
  }

  .brand-heading {
    margin-bottom: 15px;
  }

  .brand-heading h1 {
    font-size: 2.6rem;
  }

  .brand-name {
    margin-top: 8px;

    font-size: 0.8rem;
  }

  .control-room-title {
    margin-bottom: 0;
  }

  .brand-description,
  .brand-features,
  .brand-footer {
    display: none;
  }

  .access-panel {
    min-height:
      calc(100vh - 220px);

    align-items: flex-start;

    padding:
      28px
      18px
      40px;
  }

  .access-inner {
    max-width: 580px;
  }

}


@media (max-width: 520px) {

  .brand-content {
    padding:
      22px
      18px
      24px;
  }

  .brand-logo {
    width: 62px;
    height: 62px;
  }

  .brand-kicker {
    font-size: 0.65rem;
  }

  .brand-heading h1 {
    font-size: 2.25rem;
  }

  .brand-name {
    max-width: 290px;
  }

  .control-room-title {
    padding:
      8px
      11px;

    font-size: 0.65rem;
  }

  .access-panel {
    padding:
      24px
      12px
      32px;
  }

  .back-link {
    margin-left: 5px;
  }

  .system-status {
    margin-left: 5px;
  }

  .auth-card {
    padding:
      27px
      20px;

    border-radius: 14px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  input {
    height: 49px;
  }

  .access-footer {
    padding:
      0
      10px;

    text-align: center;
  }

}


@media (max-height: 760px) and (min-width: 761px) {

  .brand-content {
    padding-top: 35px;
    padding-bottom: 35px;
  }

  .brand-logo {
    width: 82px;
    height: 82px;
  }

  .brand-heading {
    margin-bottom: 16px;
  }

  .brand-heading h1 {
    font-size: 3.6rem;
  }

  .brand-description {
    margin-bottom: 20px;
  }

  .brand-feature {
    padding:
      9px
      0;
  }

  .brand-footer {
    margin-top: 20px;
  }

  .access-panel {
    padding-top: 30px;
    padding-bottom: 30px;
  }

}


/* ============================================================
   ACCESSIBILITY
   ============================================================ */

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline:
    3px solid
    rgba(201, 20, 30, 0.22);

  outline-offset: 2px;
}


@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;

    animation-duration:
      0.01ms !important;

    animation-iteration-count:
      1 !important;

    transition-duration:
      0.01ms !important;
  }

}