/* TRONIX Financial Holdings — Sign In (Dark Precision) */

:root {
  --bg-base: #0A0D14;
  --bg-panel: #0F1219;
  --bg-card: #141824;
  --border-default: #1E2535;
  --border-active: #1A6BFF;
  --accent-cobalt: #1A6BFF;
  --accent-cobalt-hover: #1557D6;
  --accent-gold: #C9A84C;
  --text-primary: #E8EDF5;
  --text-secondary: #6B7A99;
  --text-mono: #A0AEC0;
  --error: #FF4D4F;
  --success: #22C55E;
  --warning: #F59E0B;
  --font-display: 'Syne', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --radius-card: 16px;
  --radius-input: 8px;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-cobalt: 0 0 80px rgba(26, 107, 255, 0.08);
  --shadow-cobalt-hover: 0 8px 32px rgba(26, 107, 255, 0.24);
}

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

html {
  height: 100%;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

body.login-page {
  margin: 0;
  height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-display);
  overflow: hidden;
}

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

/* Session badge — top-right */
.session-badge {
  position: fixed;
  top: 16px;
  right: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(20, 24, 36, 0.85);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-input);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-mono);
  letter-spacing: 0.02em;
  backdrop-filter: blur(12px);
  animation: fadeInBadge 600ms var(--transition-base) 1600ms both;
}

.session-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulseDot 2s ease-in-out infinite;
}

.session-badge__time {
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* Shell layout 55 / 45 — locked to viewport, no page scroll */
.login-shell {
  display: flex;
  height: 100dvh;
  height: 100svh;
  max-height: 100dvh;
  max-height: 100svh;
  overflow: hidden;
}

/* —— Left brand panel —— */
.login-brand {
  position: relative;
  flex: 0 0 55%;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  padding: clamp(20px, 3vh, 40px);
  background: var(--bg-base);
  overflow: hidden;
  animation: panelFadeIn 800ms var(--transition-slow) both;
  container-type: inline-size;
  container-name: brand-panel;
}

.login-brand__mesh {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(145deg, #0A0D14 0%, #0d1528 35%, #122040 65%, #1A6BFF 120%);
  background-size: 200% 200%;
  animation: meshBreathe 6s ease-in-out infinite;
}

.login-brand__grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.04;
  background-image: radial-gradient(circle, var(--text-primary) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

#particle-canvas {
  display: none;
}

.login-brand__content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 44px;
}

.login-brand__header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  animation: slideLogoIn 600ms var(--transition-slow) 200ms both;
}

.login-brand__logo {
  height: 40px;
  width: auto;
  display: block;
}

.login-brand__wordmark {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.login-brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-primary);
  line-height: 1;
}

.login-brand__tagline-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.login-brand__tagline {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
}

.brand-info-wrap {
  position: relative;
  display: inline-flex;
}

.brand-info-btn {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid var(--border-default);
  border-radius: 50%;
  background: rgba(20, 24, 36, 0.6);
  color: var(--text-mono);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.brand-info-btn:hover,
.brand-info-btn:focus-visible {
  border-color: var(--accent-cobalt);
  color: var(--accent-cobalt);
  outline: none;
}

.brand-info-wrap:hover .brand-tooltip,
.brand-info-wrap:focus-within .brand-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.brand-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  width: max-content;
  max-width: 240px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--accent-cobalt);
  border-radius: var(--radius-input);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-mono);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 150ms var(--transition-fast), transform 150ms var(--transition-fast), visibility 150ms;
  pointer-events: none;
  box-shadow: var(--shadow-cobalt);
}

.brand-tooltip strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text-primary);
  font-weight: 500;
}

.login-brand__hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(4px, 1vh, 8px) 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  gap: clamp(10px, 1.8vh, 18px);
}

/* Horizontal workflow pipeline diagram */
.workflow-diagram {
  width: 100%;
  max-width: 100%;
  margin-top: 40px;
  margin-bottom: 32px;
  flex-shrink: 0;
  min-width: 0;
  overflow: visible;
}

.workflow-diagram__label {
  margin: 0 0 24px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #4A5568;
  text-align: center;
}

.workflow-diagram__canvas {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 120px;
  overflow: visible;
}

.workflow-diagram__row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  height: 120px;
  padding: 0;
  box-sizing: border-box;
  list-style: none;
  margin: 0;
  min-width: 0;
}

.wf-node {
  flex: 1 1 72px;
  min-width: 72px;
  max-width: 100px;
  width: auto;
  height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 8px 6px 6px;
  box-sizing: border-box;
  background: rgba(26, 107, 255, 0.06);
  border: 1px solid rgba(26, 107, 255, 0.25);
  border-radius: 10px;
  transition:
    background 300ms ease,
    border-color 300ms ease,
    box-shadow 300ms ease;
}

.wf-node--active {
  background: rgba(26, 107, 255, 0.14);
  border-color: rgba(26, 107, 255, 0.7);
  box-shadow: 0 0 18px rgba(26, 107, 255, 0.2);
}

.wf-node__icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-bottom: 6px;
  color: var(--accent-cobalt);
}

.wf-node__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--text-primary);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wf-node__sublabel {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wf-connector {
  position: relative;
  flex: 1 1 8px;
  min-width: 4px;
  max-width: 36px;
  height: 12px;
  margin: 0 2px;
  align-self: center;
}

.wf-connector__svg {
  display: block;
  width: 100%;
  height: 12px;
  overflow: visible;
}

.wf-connector__line {
  stroke: rgba(26, 107, 255, 0.35);
  stroke-width: 1.5;
}

.wf-connector__arrow {
  fill: rgba(26, 107, 255, 0.35);
}

.pulse-track {
  position: absolute;
  left: 0;
  right: 8px;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  pointer-events: none;
  overflow: hidden;
}

.pulse-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-cobalt);
  animation: pulseTravel 2s linear infinite;
  animation-delay: var(--pulse-delay, 0s);
}

@keyframes pulseTravel {
  0% {
    transform: translateX(0);
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  92% {
    opacity: 1;
  }
  100% {
    transform: translateX(calc(100% + 8px));
    opacity: 0;
  }
}

.brand-headline {
  margin: 0;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  flex-shrink: 0;
}

.headline-line {
  display: block;
  font-family: var(--font-display);
  max-width: 100%;
}

.headline-line--primary {
  font-weight: 800;
  font-size: clamp(1.35rem, 2.8vh, 2.625rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  animation: revealLine 700ms var(--transition-slow) 1000ms both;
}

.headline-line--platform {
  font-weight: 400;
  font-size: clamp(0.95rem, 1.8vh, 1.75rem);
  line-height: 1.15;
  letter-spacing: 0.28em;
  color: var(--accent-cobalt);
  margin-top: 2px;
  animation: revealLine 700ms var(--transition-slow) 1150ms both;
}

.login-brand__subtitle {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(13px, 1.8vh, 15px);
  line-height: 1.4;
  color: var(--text-secondary);
  max-width: 400px;
  flex-shrink: 0;
  animation: fadeUp 600ms var(--transition-slow) 1300ms both;
}

.trust-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0;
  flex-shrink: 0;
  animation: fadeUp 600ms var(--transition-slow) 1400ms both;
}

.workflow-diagram + .trust-pills {
  margin-top: 0;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-input);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-mono);
  background: rgba(20, 24, 36, 0.5);
  backdrop-filter: blur(8px);
}

.trust-pill svg {
  flex-shrink: 0;
  color: var(--accent-cobalt);
}

.trust-pill--accent {
  border-color: rgba(201, 168, 76, 0.35);
}

.trust-pill--accent svg {
  color: var(--accent-gold);
}

/* Bottom status bar */
.brand-status-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 3vw, 32px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  background: rgba(10, 13, 20, 0.72);
  backdrop-filter: blur(8px);
}

.brand-status-bar__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.brand-status-bar__item--live {
  color: var(--text-mono);
}

.brand-status-bar__item--count {
  flex: 1;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-status-bar__item--version {
  color: var(--text-secondary);
}

.brand-status-bar__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  animation: pulseDot 2s ease-in-out infinite;
}

#workflow-count {
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* —— Right form panel —— */
.login-form-panel {
  flex: 0 0 45%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  padding: clamp(24px, 4vh, 48px) clamp(24px, 4vw, 56px);
  background: var(--bg-panel);
  overflow: hidden;
  gap: 16px;
}

.login-form-panel__inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  max-width: min(460px, 94%);
  max-height: 100%;
  min-height: 0;
  flex: 0 1 auto;
  gap: 16px;
}

.login-card {
  width: 100%;
  flex: 0 1 auto;
  max-height: calc(100dvh - 56px);
  max-height: calc(100svh - 56px);
  margin: 0;
  padding: clamp(40px, 5vh, 48px);
  background: var(--bg-card);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-cobalt), 0 20px 40px rgba(0, 0, 0, 0.32);
  animation: cardScaleIn 600ms var(--transition-slow) 1200ms both;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  overflow: hidden;
}

.login-card--error {
  animation: cardShake 300ms ease-in-out, cardScaleIn 600ms var(--transition-slow) 1200ms both;
}

.login-card--error-flash {
  border-left-color: var(--error);
  animation: errorBorderFlash 600ms var(--transition-base);
}

.login-card__header {
  margin-bottom: 32px;
}

.login-card__title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 3.2vh, 34px);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.login-card__desc {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* Alert messages */
.alert-banner {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  transition: max-height var(--transition-slow), opacity var(--transition-base), margin var(--transition-base);
}

.alert-banner.is-visible {
  max-height: 80px;
  opacity: 1;
  margin-bottom: 16px;
}

.alert-banner__inner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-input);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
}

.alert-banner--error .alert-banner__inner {
  background: rgba(255, 77, 79, 0.08);
  border: 1px solid rgba(255, 77, 79, 0.3);
  color: var(--error);
}

.alert-banner--warning .alert-banner__inner {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--warning);
}

.alert-banner__progress {
  height: 2px;
  background: rgba(255, 77, 79, 0.2);
  margin-top: 8px;
  border-radius: 1px;
  overflow: hidden;
}

.alert-banner__progress-bar {
  height: 100%;
  width: 100%;
  background: var(--error);
  transform-origin: left;
  animation: progressDeplete 5s linear forwards;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
}

.field-group {
  position: relative;
  margin-bottom: 28px;
  animation: fieldSlideUp 500ms var(--transition-slow) both;
}

.login-form > .field-group:nth-child(2) { animation-delay: 1400ms; }
.login-form > .field-group:nth-child(3) { animation-delay: 1520ms; }

.field-group__input {
  width: 100%;
  height: 56px;
  padding: 22px 16px 8px;
  background-color: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-input);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.4;
  color-scheme: dark;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 200ms var(--transition-fast), box-shadow 200ms var(--transition-fast), background-color 200ms var(--transition-fast);
}

.field-group__input:-webkit-autofill,
.field-group__input:-webkit-autofill:hover,
.field-group__input:-webkit-autofill:focus,
.field-group__input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text-primary) !important;
  caret-color: var(--text-primary);
  box-shadow: 0 0 0 1000px var(--bg-base) inset !important;
  border-color: var(--border-default) !important;
  transition: background-color 99999s ease-out 0s;
}

.field-group__input:-webkit-autofill + .field-group__label {
  top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.field-group__input:-webkit-autofill:focus + .field-group__label {
  color: var(--accent-cobalt);
}

.field-group__input:focus {
  border-color: var(--border-active);
  box-shadow: inset 0 0 0 1px var(--border-active), 0 0 0 3px rgba(26, 107, 255, 0.12);
}

.field-group__input:focus + .field-group__label,
.field-group__input:not(:placeholder-shown) + .field-group__label {
  top: 10px;
  font-size: 12px;
  color: var(--accent-cobalt);
}

.field-group__label {
  position: absolute;
  left: 16px;
  top: 18px;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-secondary);
  pointer-events: none;
  transition: top var(--transition-base), font-size var(--transition-base), color var(--transition-base);
  background: transparent;
}

.field-group__underline {
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--accent-cobalt);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms var(--transition-fast);
  border-radius: 0 0 var(--radius-input) var(--radius-input);
  pointer-events: none;
}

.field-group__input:focus ~ .field-group__underline {
  transform: scaleX(1);
}

.field-group--password .field-group__input {
  padding-right: 52px;
}

.field-group__toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--accent-cobalt);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.field-group__toggle:hover {
  background: rgba(26, 107, 255, 0.1);
}

.field-group__toggle:focus-visible {
  outline: 2px solid var(--accent-cobalt);
  outline-offset: 2px;
}

.field-group__toggle svg {
  width: 20px;
  height: 20px;
}

.field-group__toggle .icon-eye-off {
  display: none;
}

.field-group__toggle.is-visible .icon-eye {
  display: none;
}

.field-group__toggle.is-visible .icon-eye-off {
  display: block;
}

.form-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 28px;
  animation: fieldSlideUp 500ms var(--transition-slow) 1640ms both;
}

.form-row__link {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-cobalt);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.form-row__link:hover {
  color: var(--text-primary);
}

.form-row__link:focus-visible {
  outline: 2px solid var(--accent-cobalt);
  outline-offset: 4px;
}

.btn-signin {
  position: relative;
  width: 100%;
  height: 56px;
  border: none;
  border-radius: var(--radius-input);
  background: var(--accent-cobalt);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: background var(--transition-base), transform var(--transition-fast), box-shadow var(--transition-base);
  animation: fieldSlideUp 500ms var(--transition-slow) 1760ms both;
}

.btn-signin:hover:not(:disabled) {
  background: var(--accent-cobalt-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-cobalt-hover);
}

.btn-signin:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-signin:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 4px;
}

.btn-signin:disabled {
  cursor: wait;
  opacity: 0.9;
}

.btn-signin__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-signin__loading,
.btn-signin__success {
  display: none;
}

.btn-signin__text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-signin__arrow {
  display: inline-block;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.btn-signin:hover:not(:disabled) .btn-signin__arrow,
.btn-signin:focus-visible:not(:disabled) .btn-signin__arrow {
  opacity: 1;
  transform: translateX(0);
}

.btn-signin__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(232, 237, 245, 0.3);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.btn-signin.is-loading .btn-signin__text {
  display: none;
}

.btn-signin.is-loading .btn-signin__loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.btn-signin.is-loading .btn-signin__spinner {
  display: inline-block;
}

.btn-signin.is-success {
  background: var(--success);
}

.btn-signin__success {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-signin.is-success .btn-signin__text,
.btn-signin.is-success .btn-signin__loading {
  display: none;
}

.btn-signin.is-success .btn-signin__success {
  display: inline-flex;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-default);
}

.btn-microsoft {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md, 8px);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary, #e8ecf4);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  animation: fieldSlideUp 500ms var(--transition-slow) 1920ms both;
}

.btn-microsoft:hover,
.btn-microsoft:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-primary, #fff);
  outline: none;
}

.btn-microsoft--unconfigured {
  border-color: rgba(255, 193, 7, 0.45);
}

.btn-microsoft__icon {
  display: flex;
  flex-shrink: 0;
}

.security-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-default);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--text-secondary);
  animation: fieldSlideUp 500ms var(--transition-slow) 1880ms both;
  overflow: hidden;
}

.security-footer svg {
  flex-shrink: 0;
  color: var(--accent-cobalt);
}

.security-footer span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.login-copyright {
  margin: 0;
  flex-shrink: 0;
  width: 100%;
  max-width: min(460px, 94%);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.2;
  color: var(--text-secondary);
}

/* Gold micro-detail on brand header border */
.login-brand__header {
  padding-bottom: 16px;
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, var(--accent-gold) 0%, transparent 40%) 1;
}

/* Keyframes */
@keyframes panelFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes meshBreathe {
  0%, 100% {
    background-position: 0% 50%;
    filter: brightness(1);
  }
  50% {
    background-position: 100% 50%;
    filter: brightness(1.08);
  }
}

@keyframes slideLogoIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes revealLine {
  from {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
  }
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardScaleIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fieldSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@keyframes errorBorderFlash {
  0% { border-left-color: var(--error); border-left-width: 3px; }
  100% { border-left-color: var(--border-default); border-left-width: 2px; }
}

@keyframes progressDeplete {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.92); }
}

@keyframes fadeInBadge {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .login-brand__mesh {
    animation: none;
  }

  #particle-canvas {
    display: none;
  }

  .pulse-dot {
    animation: none;
    opacity: 0.6;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* Short viewports — tighten further */
@media (max-height: 720px) {
  .login-brand__hero {
    padding: 4px 0;
  }

  .trust-pill {
    padding: 6px 12px;
    font-size: 10px;
  }

  .login-card {
    padding: 20px;
  }

  .login-card__header {
    margin-bottom: 12px;
  }
}

@media (max-height: 700px) {
  .workflow-diagram {
    margin-top: 24px;
    margin-bottom: 20px;
  }

  .headline-line--primary {
    font-size: 1.25rem;
  }

  .headline-line--platform {
    font-size: 0.9rem;
  }
}

@media (max-height: 600px) {
  .workflow-diagram {
    display: none;
  }

  .login-brand__subtitle {
    display: none;
  }

  .trust-pills {
    display: none;
  }

  .brand-status-bar__item--count {
    display: none;
  }
}

/* Narrow left panel: scale pipeline to fit */
@container brand-panel (max-width: 820px) {
  .wf-node {
    max-width: 92px;
  }

  .wf-connector {
    max-width: 28px;
  }
}

@container brand-panel (max-width: 680px) {
  .wf-node {
    max-width: 80px;
    height: 60px;
    padding: 6px 4px;
  }

  .wf-node__label {
    font-size: 10px;
  }

  .wf-node__sublabel {
    font-size: 8px;
    letter-spacing: 0.06em;
  }

  .wf-connector {
    max-width: 20px;
    margin: 0 1px;
  }
}

/* Tablet: compact pipeline nodes */
@media (max-width: 1100px) and (min-width: 768px) {
  .wf-node {
    max-width: 88px;
    height: 60px;
    padding: 6px 4px;
  }

  .wf-node__label {
    font-size: 10px;
  }

  .wf-node__sublabel {
    font-size: 8px;
  }

  .wf-connector {
    max-width: 24px;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .login-shell {
    flex-direction: column;
  }

  .login-brand {
    flex: 0 0 auto;
    height: auto;
    max-height: 96px;
    min-height: 0;
    padding: 12px 16px;
  }

  .workflow-diagram {
    display: none;
  }

  .login-brand__hero .brand-headline,
  .login-brand__hero .login-brand__subtitle {
    display: none;
  }

  .trust-pills {
    display: none;
  }

  .login-brand__subtitle {
    display: none;
  }

  .system-status {
    display: none;
  }

  .login-brand__header {
    margin: 0;
    padding-bottom: 0;
    border: none;
  }

  .login-form-panel {
    flex: 1;
    min-height: 0;
    height: auto;
    padding: 12px 16px 16px;
  }

  .login-form-panel__inner {
    max-height: 100%;
  }

  .login-card {
    padding: 32px 24px;
    max-height: calc(100svh - 120px);
  }

  .session-badge {
    top: 8px;
    right: 8px;
    left: 8px;
    justify-content: center;
    font-size: 10px;
  }

}
