:root {
  --bg-abyss: #030b16;
  --bg-navy: #06172B;
  --bg-navy-mid: #0a2444;
  --bg-panel: #061324;
  --bg-panel-deep: #040d1a;
  --brand-blue: #0078D7;
  --brand-deep: #003D91;
  --brand-cyan: #00C8F4;
  --brand-cyan-soft: rgba(0, 200, 244, 0.28);
  --text-light: #F4F7FB;
  --text-muted: #B6CBE0;
  --text-dark: #1E2A38;
  --ink-btn: #031222;
  --error-coral: #FF7B89;
  --error-bg: rgba(110, 22, 36, 0.42);
  --success-cyan: #6CE8FF;
  --success-bg: rgba(0, 120, 215, 0.22);
  --focus-ring: #00C8F4;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background: var(--bg-abyss);
  color: var(--text-light);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45;
  overflow-x: hidden;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--brand-cyan);
  color: var(--ink-btn);
  font-weight: 700;
  border-radius: 6px;
  text-decoration: none;
}

.skip-link:focus {
  left: 12px;
}

:focus-visible {
  outline: 2.5px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Main Split Shell */
.login-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(360px, 1fr);
  min-height: 100vh;
  width: 100%;
  background:
    radial-gradient(circle at 38% 58%, rgba(0, 120, 215, 0.18) 0%, rgba(6, 23, 43, 0) 52%),
    linear-gradient(135deg, #030b16 0%, #06172B 54%, #040d1a 100%);
  overflow: hidden;
}

/* Left Hero Showcase */
.hero-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  padding: 0 48px 32px 0;
  overflow: hidden;
}

.atmosphere-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.server-racks-svg {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 310px;
  opacity: 0.9;
}

.circuit-overlay-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.control-desk-svg {
  position: absolute;
  left: 52%;
  bottom: 110px;
  transform: translateX(-50%);
  width: min(680px, 84%);
  height: auto;
  opacity: 0.78;
}

/* Upper-left brand header */
.brand-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  width: 100%;
}

/*
  MAIN RECOMMENDATION: Intentional architectural light-to-dark brand sweep.
  Anchored flush to the top-left perimeter with a chamfered diagonal lower edge,
  preserving the official unmodified logo's dark text (#1E2A38) at >11:1 contrast
  before transitioning smoothly into the dark navy control-room atmosphere.
*/
.brand-architectural-zone {
  position: relative;
  width: min(630px, 88%);
  padding: 20px 96px 22px 38px;
  background: linear-gradient(
    112deg,
    #F5F8FC 0%,
    #EEF4FB 54%,
    #DCEAF8 69%,
    rgba(24, 62, 110, 0.88) 87%,
    rgba(6, 23, 43, 0.94) 100%
  );
  clip-path: polygon(0 0, 100% 0, 89% 100%, 0 100%);
  box-shadow: inset 0 -2px 0 rgba(0, 200, 244, 0.55);
}

.brand-architectural-zone::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, #0078D7 0%, #00C8F4 62%, rgba(0, 200, 244, 0) 100%);
}

.brand-logo-img {
  display: block;
  width: min(410px, 100%);
  height: auto;
  mix-blend-mode: multiply;
}

/* Variant B: Unapproved transparent derivative directly on dark navy background */
body[data-logo-variant="transparent-dark"] .brand-architectural-zone {
  width: auto;
  padding: 24px 32px 12px 42px;
  background: transparent;
  clip-path: none;
  box-shadow: none;
}

body[data-logo-variant="transparent-dark"] .brand-architectural-zone::after {
  display: none;
}

body[data-logo-variant="transparent-dark"] .brand-logo-img {
  width: min(440px, 100%);
  mix-blend-mode: normal;
}

/* Slogan block */
.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  padding: 18px 24px 12px 120px;
  margin-bottom: auto;
  margin-top: 28px;
}

.slogan-block {
  max-width: 560px;
}

.hero-slogan {
  margin: 0;
  font-size: clamp(1.45rem, 2.35vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-shadow: 0 2px 16px rgba(2, 10, 22, 0.85);
}

.slogan-light {
  display: block;
  color: var(--text-light);
}

.slogan-cyan {
  display: block;
  color: var(--brand-cyan);
}

.slogan-accent-line {
  display: flex;
  align-items: center;
  margin-top: 12px;
  max-width: 440px;
}

.accent-bar {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, rgba(0, 200, 244, 0.15) 0%, #00C8F4 80%);
}

.accent-node {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-cyan);
  box-shadow: 0 0 10px var(--brand-cyan);
}

/* Five Line Icons Row */
.capabilities-strip {
  position: relative;
  z-index: 2;
  padding: 0 12px 0 88px;
  margin-top: 18px;
}

.capabilities-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.capability-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.capability-badge {
  width: 68px;
  height: 52px;
  border-radius: 10px;
  border: 1px solid rgba(0, 200, 244, 0.42);
  background: linear-gradient(180deg, rgba(10, 34, 66, 0.78) 0%, rgba(4, 15, 31, 0.9) 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(0, 200, 244, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-cyan);
}

.capability-svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.capability-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: #DCE9F7;
  line-height: 1.25;
}

/* Glowing Diagonal Split Seam */
.diagonal-divider {
  position: absolute;
  top: -8%;
  bottom: -8%;
  left: 58.6%;
  width: 3px;
  transform: rotate(11deg);
  transform-origin: center center;
  background: linear-gradient(
    180deg,
    rgba(0, 200, 244, 0.12) 0%,
    rgba(0, 200, 244, 0.95) 45%,
    rgba(0, 120, 215, 0.75) 75%,
    rgba(0, 200, 244, 0.15) 100%
  );
  box-shadow: 0 0 22px 2px rgba(0, 200, 244, 0.48);
  pointer-events: none;
  z-index: 3;
}

/* Right Dark Login Panel */
.auth-panel {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 44px 40px 56px;
  background:
    radial-gradient(circle at 75% 18%, rgba(0, 120, 215, 0.18) 0%, rgba(4, 13, 26, 0) 50%),
    linear-gradient(160deg, rgba(6, 20, 39, 0.94) 0%, rgba(3, 11, 22, 0.98) 100%);
  clip-path: polygon(8% 0, 100% 0, 100% 100%, 0 100%);
}

.auth-card {
  width: 100%;
  max-width: 416px;
  padding: 36px 32px 28px;
  border-radius: 18px;
  border: 1px solid rgba(0, 200, 244, 0.34);
  background: linear-gradient(180deg, rgba(9, 27, 52, 0.88) 0%, rgba(5, 16, 33, 0.94) 100%);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(0, 200, 244, 0.22);
}

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

.auth-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-heading {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: -0.015em;
}

.auth-slashes {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.slash {
  display: inline-block;
  width: 10px;
  height: 22px;
  transform: skewX(-22deg);
  border-radius: 2px;
}

.slash-bright {
  background: var(--brand-cyan);
}

.slash-deep {
  background: var(--brand-blue);
}

.auth-subtitle {
  margin: 6px 0 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* Form Controls */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #E2EEF9;
}

.input-shell {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(182, 203, 224, 0.3);
  background: rgba(3, 13, 27, 0.82);
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.input-shell:focus-within {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 2px rgba(0, 200, 244, 0.24);
  background: rgba(4, 17, 35, 0.95);
}

.input-shell.is-invalid {
  border-color: var(--error-coral);
  box-shadow: 0 0 0 2px rgba(255, 123, 137, 0.2);
}

.input-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 10px;
  color: var(--brand-cyan);
  flex-shrink: 0;
}

.input-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.input-shell input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-size: 0.98rem;
  font-family: inherit;
  padding: 11px 4px;
  outline: none;
}

.input-shell input::placeholder {
  color: #8CA6C2;
}

.toggle-password-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  margin-left: 4px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #B6CBE0;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease;
}

.toggle-password-btn:hover {
  color: var(--brand-cyan);
  background: rgba(0, 200, 244, 0.12);
}

.eye-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.field-error {
  margin: 0;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--error-bg);
  border-left: 3px solid var(--error-coral);
  color: #FFD6DB;
  font-size: 0.84rem;
}

.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  margin-top: 6px;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, #27DCFF 0%, #00C2F0 52%, #008DE2 100%);
  color: var(--ink-btn);
  font-size: 1.02rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 200, 244, 0.3);
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}

.submit-btn:hover {
  filter: brightness(1.06);
  box-shadow: 0 10px 28px rgba(0, 200, 244, 0.42);
}

.submit-btn:active {
  transform: translateY(1px);
}

.submit-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.submit-feedback {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0, 200, 244, 0.45);
  background: var(--success-bg);
  color: var(--text-light);
}

.submit-feedback-text {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: #DCF6FF;
}

.reset-preview-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(0, 200, 244, 0.55);
  background: rgba(3, 18, 34, 0.75);
  color: var(--brand-cyan);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.reset-preview-btn:hover {
  background: rgba(0, 200, 244, 0.16);
}

.auth-footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(182, 203, 224, 0.14);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}

.synthetic-note {
  margin: 0;
  font-size: 0.78rem;
  color: #9FB7D0;
}

.variants-link {
  color: var(--brand-cyan);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.variants-link:hover {
  color: #8DE8FF;
}

/* Tablet / Narrow Desktop */
@media (max-width: 1120px) {
  .hero-panel {
    padding: 0 28px 28px 0;
  }

  .hero-content {
    padding: 16px 20px 12px 64px;
  }

  .capabilities-strip {
    padding: 0 8px 0 42px;
  }

  .auth-panel {
    padding: 32px 28px 32px 42px;
  }
}

/* Mobile & Android (390x844, 393x852, 320x568 and <= 959px) */
@media (max-width: 959px) {
  .login-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto 1fr;
    align-content: start;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: clip;
    overflow-y: visible;
  }

  /* Flatten hero-panel visually on mobile so form sits above slogan & icons
     while keeping desktop composition and logical keyboard order intact. */
  .hero-panel {
    display: contents;
  }

  .diagonal-divider {
    display: none;
  }

  .atmosphere-layer {
    opacity: 0.24;
  }

  .server-racks-svg {
    width: 140px;
    opacity: 0.45;
  }

  .circuit-overlay-svg {
    opacity: 0.5;
  }

  .control-desk-svg {
    left: 50%;
    bottom: 6px;
    width: 96%;
    max-width: 460px;
    opacity: 0.35;
  }

  .brand-header {
    grid-column: 1;
    grid-row: 1;
    z-index: 2;
  }

  .brand-architectural-zone {
    width: 100%;
    padding: 10px 16px 14px;
    overflow: hidden;
    clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
    background: linear-gradient(
      180deg,
      #F5F8FC 0%,
      #EAF2FA 76%,
      rgba(16, 48, 86, 0.94) 100%
    );
  }

  body[data-logo-variant="transparent-dark"] .brand-architectural-zone {
    padding: 12px 16px 6px;
  }

  .brand-logo-img {
    width: min(228px, 62%);
    margin-top: clamp(-18px, -4vw, -12px);
    margin-bottom: clamp(-20px, -4.5vw, -13px);
  }

  body[data-logo-variant="transparent-dark"] .brand-logo-img {
    width: min(228px, 62%);
  }

  .auth-panel {
    grid-column: 1;
    grid-row: 2;
    z-index: 2;
    padding: 12px 14px 12px;
    clip-path: none;
    background: transparent;
    align-items: stretch;
  }

  .auth-card {
    max-width: 440px;
    margin: 0 auto;
    padding: 18px 16px 14px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(9, 27, 52, 0.94) 0%, rgba(5, 16, 33, 0.97) 100%);
  }

  .auth-header {
    margin-bottom: 14px;
  }

  .auth-heading {
    font-size: 1.32rem;
  }

  .auth-subtitle {
    margin-top: 3px;
    font-size: 0.86rem;
  }

  .login-form {
    gap: 12px;
  }

  .field-group {
    gap: 5px;
  }

  .input-shell {
    min-height: 46px;
    padding: 0 10px;
  }

  .input-shell input {
    font-size: 1rem;
    padding: 10px 4px;
  }

  .toggle-password-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .submit-btn {
    min-height: 48px;
    margin-top: 2px;
  }

  .reset-preview-btn {
    min-height: 44px;
    padding: 8px 14px;
  }

  .auth-footer {
    margin-top: 12px;
    padding-top: 10px;
    gap: 2px;
  }

  .variants-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 6px 10px;
  }

  .hero-content {
    grid-column: 1;
    grid-row: 3;
    z-index: 2;
    padding: 10px 18px 4px;
    margin: 0;
    justify-content: flex-start;
  }

  .hero-slogan {
    font-size: 1.15rem;
    line-height: 1.24;
  }

  .slogan-accent-line {
    margin-top: 8px;
  }

  .capabilities-strip {
    grid-column: 1;
    grid-row: 4;
    z-index: 2;
    padding: 10px 14px 22px;
    margin-top: 0;
  }

  .capabilities-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 8px;
  }

  .capability-badge {
    width: 48px;
    height: 40px;
  }

  .capability-svg {
    width: 21px;
    height: 21px;
  }

  .capability-label {
    font-size: 0.72rem;
  }
}

/* Extra-small phones & 320x568 ergonomics */
@media (max-width: 380px) {
  .brand-architectural-zone {
    padding: 8px 12px 11px;
  }

  .brand-logo-img {
    width: min(196px, 62%);
  }

  .auth-panel {
    padding: 8px 10px 10px;
  }

  .auth-card {
    padding: 15px 12px 12px;
  }

  .auth-header {
    margin-bottom: 10px;
  }

  .auth-heading {
    font-size: 1.2rem;
  }

  .slash {
    width: 8px;
    height: 18px;
  }

  .login-form {
    gap: 10px;
  }

  .hero-content {
    padding: 8px 12px 4px;
  }

  .hero-slogan {
    font-size: 1.05rem;
  }

  .capabilities-strip {
    padding: 8px 10px 18px;
  }

  .capabilities-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 6px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* LAB-012: password visibility only */
.eye-icon[hidden] { display: none; }
.input-shell input::-ms-reveal, .input-shell input::-ms-clear { display: none; width: 0; height: 0; }
