/* Login stage: the same 12-column skeleton as the dashboard. */

.login-page {
  min-height: 100svh;
}

.login-frame {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  width: 100%;
  min-height: 100svh;
}

.login-stage {
  grid-column: span 7;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100svh;
  padding: clamp(24px, 4vw, 58px);
  overflow: hidden;
  color: var(--on-accent);
  background:
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.2) 0,
      rgba(0, 0, 0, 0.2) 1px,
      rgba(255, 255, 255, 0.035) 1px,
      rgba(255, 255, 255, 0.035) 2px,
      transparent 2px,
      transparent 11%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), transparent 38%),
    var(--accent);
}

.login-stage::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 24%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.24));
  pointer-events: none;
}

.login-brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
}

.login-brand .micro {
  margin: 0 0 4px;
  color: var(--on-accent);
  opacity: 0.78;
  white-space: nowrap;
}

.login-wordmark {
  margin: 0;
  color: var(--on-accent);
  font-size: clamp(22px, 2.2vw, 32px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.login-wordmark span {
  color: var(--accent2);
}

.login-stage-copy {
  position: relative;
  z-index: 2;
  margin-top: clamp(58px, 12vh, 150px);
  max-width: 650px;
}

.login-stage-copy .kicker {
  color: var(--on-accent);
  opacity: 0.8;
}

.login-stage-copy h1 {
  margin: 18px 0 24px;
  color: var(--on-accent);
  font-size: clamp(100px, 12vw, 180px);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.07em;
}

.login-stage-copy p:last-child {
  max-width: 28ch;
  margin: 0;
  color: var(--on-accent);
  font-size: clamp(12px, 1.1vw, 16px);
  line-height: 1.7;
  opacity: 0.86;
}

.login-ornament {
  position: absolute;
  right: -48px;
  bottom: -55px;
  z-index: 1;
  width: min(43vw, 520px);
  opacity: 0.82;
  pointer-events: none;
}

.login-ornament svg {
  display: block;
  width: 100%;
  height: auto;
}

.login-stage-foot {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 4px solid var(--accent2);
  color: var(--on-accent);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  opacity: 0.8;
}

.login-panel {
  grid-column: span 5;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100svh;
  padding: clamp(24px, 4vw, 58px);
  background: var(--surface);
}

.login-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 4px solid var(--line);
}

.login-head .kicker {
  color: var(--accent2);
}

.login-form-wrap {
  width: min(100%, 420px);
  margin-top: auto;
  margin-bottom: auto;
  padding: 38px 0;
}

.login-form-wrap h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(44px, 4.8vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.login-sub {
  margin: 10px 0 32px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.field {
  position: relative;
  display: block;
  margin-bottom: 24px;
}

.field > span {
  display: block;
  margin-bottom: 6px;
  color: var(--accent2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  height: 52px;
  padding: 0 12px;
  border: 0;
  border-bottom: 4px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 18px;
  font-weight: 400;
  outline: none;
}

.field input[readonly] {
  color: var(--muted);
  border-bottom-color: var(--accent3);
}

.field input:focus-visible {
  border-bottom-color: var(--accent2);
  outline: 2px solid var(--accent2);
  outline-offset: 3px;
}

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

.reveal {
  position: absolute;
  right: 0;
  bottom: 9px;
  height: 34px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--accent2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.reveal:hover {
  color: var(--ink);
}

.login-error {
  margin: 0 0 18px;
  padding: 10px 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}

.login-error.success {
  background: var(--bg);
  color: var(--accent2);
  border-left: 4px solid var(--accent2);
}

.login-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 56px;
  margin-top: 4px;
  padding: 0 16px;
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  transition: background var(--fast), color var(--fast), transform var(--fast);
}

.login-submit:hover {
  background: var(--accent2);
  color: var(--bg);
}

.login-submit:active {
  transform: translate(2px, 2px);
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.login-arrow {
  font-size: 20px;
  line-height: 1;
}

.login-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 4px solid var(--line);
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.login-panel-foot {
  margin-top: auto;
}

.login-panel-foot .note-line {
  display: block;
  height: 4px;
  background: var(--line);
}

.login-panel-foot p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

@media (max-width: 1000px) {
  .login-stage {
    grid-column: span 12;
    min-height: 48svh;
  }

  .login-panel {
    grid-column: span 12;
    min-height: auto;
  }

  .login-stage-copy {
    margin-top: 8vh;
  }

  .login-stage-copy h1 {
    font-size: clamp(96px, 18vw, 150px);
  }

  .login-form-wrap {
    width: 100%;
    max-width: 560px;
    margin: 36px 0;
  }
}

@media (max-width: 620px) {
  .login-stage {
    min-height: 44svh;
    padding: 20px 16px;
  }

  .login-brand {
    gap: 10px;
  }

  .login-brand .brand-seal {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
  }

  .login-brand .seal-circle {
    width: 26px;
    height: 26px;
  }

  .login-brand .seal-square {
    width: 18px;
    height: 18px;
  }

  .login-brand .seal-triangle {
    right: 9px;
    border-left-width: 7px;
    border-right-width: 7px;
    border-bottom-width: 12px;
  }

  .login-brand .micro {
    font-size: 7px;
    letter-spacing: 0.1em;
  }

  .login-wordmark {
    font-size: 19px;
  }

  .login-stage-copy {
    margin-top: 46px;
  }

  .login-stage-copy h1 {
    margin: 12px 0 14px;
    font-size: 86px;
  }

  .login-stage-copy p:last-child {
    font-size: 11px;
    max-width: 24ch;
  }

  .login-stage-foot {
    margin-top: 28px;
    font-size: 7px;
  }

  .login-panel {
    padding: 20px 16px 28px;
  }

  .login-form-wrap {
    margin: 28px 0 20px;
    padding: 0;
  }

  .login-form-wrap h2 {
    font-size: 42px;
  }

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

  .login-panel-foot {
    margin-top: 8px;
  }

  .login-ornament {
    width: 250px;
    right: -80px;
    bottom: -40px;
    opacity: 0.55;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-submit:active,
  .login-submit:hover,
  .reveal {
    transform: none;
  }
}
