@import url("./login.css");

/* Member auth — professional authority surface */

.login-stage .stage-brand {
  position: relative;
  max-width: 28rem;
  animation: auth-stage-in 0.7s ease both;
}

.login-stage .stage-eyebrow {
  position: relative;
  margin: 0 0 0.85rem;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(215, 179, 122, 0.92);
}

.login-stage .mark {
  animation: auth-mark-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-stage .meta span {
  position: relative;
  padding-left: 0.85rem;
}

.login-stage .meta span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 0.35rem;
  height: 0.35rem;
  margin-top: -0.175rem;
  border-radius: 1px;
  background: rgba(215, 179, 122, 0.75);
}

.login-panel {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(720px 380px at 92% -12%, rgba(15, 76, 92, 0.13), transparent 58%),
    radial-gradient(520px 320px at 0% 110%, rgba(176, 141, 87, 0.1), transparent 52%),
    linear-gradient(165deg, #f3f6fa 0%, #e9eef5 48%, #e4ebf3 100%);
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.35;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(15, 76, 92, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 76, 92, 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 20%, transparent 75%);
}

.login-panel > * {
  position: relative;
  z-index: 1;
}

.auth-card {
  position: relative;
  width: min(100%, 500px);
  border: 1px solid rgba(176, 141, 87, 0.32);
  border-radius: 14px;
  padding: 1.55rem 1.9rem 1.75rem;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  box-shadow:
    0 28px 60px rgba(10, 20, 34, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  animation: auth-card-in 0.55s ease both 0.08s;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-deep) 0%, var(--brand) 45%, var(--accent) 100%);
}

.auth-card::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(15, 76, 92, 0.06);
  border-radius: 2px 2px 10px 10px;
  pointer-events: none;
}

/* Language switcher on auth pages — same visual (incl. hover) as the home page.
   The auth card also carries the `.login-card` class, whose `button` rules
   (`login.css`) would otherwise stretch the earth-button and each menu option
   and repaint them. These higher-specificity `.auth-card` rules restore the
   shared brand-base look so auth pages match the home nav exactly. */
.auth-card .lang-switcher {
  display: block;
  width: fit-content;
  margin: 0 0 0.6rem auto;
}
.auth-card .lang-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-top: 0;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink-soft);
  font: inherit;
  font-weight: inherit;
  /* same hover as home */
}
.auth-card .lang-trigger:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--ink-soft);
}
.auth-card .lang-trigger:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.auth-card .lang-option {
  width: 100%;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 500;
  /* same hover as home */
}
.auth-card .lang-option:hover {
  background: var(--brand-soft);
  color: var(--brand-deep);
}
.auth-card .lang-option.is-active {
  color: var(--brand);
  font-weight: 650;
}

.auth-seal {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.1rem;
  padding: 0.35rem 0.65rem 0.35rem 0.4rem;
  border: 1px solid rgba(15, 76, 92, 0.18);
  background: rgba(15, 76, 92, 0.04);
  color: var(--brand-deep);
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: auth-seal-in 0.6s ease both 0.18s;
}

.auth-seal-mark {
  width: 0.55rem;
  height: 0.55rem;
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.auth-card-head {
  margin-bottom: 1.35rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid rgba(15, 76, 92, 0.1);
}

.auth-card .kicker {
  display: inline-block;
  margin-bottom: 0.55rem;
  color: var(--accent-ink);
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.auth-card h1 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-size: clamp(2rem, 3.2vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.05;
}

.auth-card .sub {
  margin: 0;
  max-width: 40ch;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.auth-card label {
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-card input {
  border-radius: 8px;
  border: 1px solid #b7c3d4;
  background: #fff;
  padding: 0.92rem 0.95rem;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  text-transform: none;
  font-weight: 500;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-card input::placeholder {
  color: rgba(93, 107, 130, 0.72);
  font-weight: 400;
}

.auth-card input:focus {
  outline: none;
  border-color: #b08d57;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(176, 141, 87, 0.2);
}

.auth-card .auth-submit {
  width: 100%;
  margin-top: 0.65rem;
  border: 1px solid rgba(176, 141, 87, 0.45);
  border-radius: 10px;
  padding: 1rem 1.05rem;
  background: linear-gradient(180deg, #1d3d5c 0%, #17324d 48%, #0e2034 100%);
  color: #fff;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.auth-card .auth-submit:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.auth-card .auth-submit:active {
  transform: translateY(0);
}

.auth-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: end;
}

.auth-row label {
  margin: 0;
}

.auth-row .otp-send {
  width: auto;
  height: 48px;
  margin-top: 0;
  padding: 0 1.05rem;
  border: 1px solid rgba(15, 76, 92, 0.32);
  border-radius: 8px;
  background: rgba(15, 76, 92, 0.04);
  color: var(--brand-deep);
  font-family: var(--font);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.auth-row .otp-send:hover:not(:disabled) {
  background: rgba(15, 76, 92, 0.09);
  border-color: rgba(15, 76, 92, 0.5);
}

.auth-row .otp-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-msg {
  margin: 0 0 0.95rem;
  padding: 0.72rem 0.85rem;
  border-radius: 8px;
  font-size: 0.86rem;
  line-height: 1.45;
}

.auth-msg.ok {
  background: rgba(31, 122, 76, 0.08);
  color: #1a6640;
  border: 1px solid rgba(31, 122, 76, 0.22);
}

.auth-msg.err {
  background: rgba(180, 35, 24, 0.06);
  color: #9b241c;
  border: 1px solid rgba(180, 35, 24, 0.2);
}

.auth-msg.warn {
  background: rgba(168, 110, 20, 0.08);
  color: #7a4e0b;
  border: 1px solid rgba(168, 110, 20, 0.28);
  white-space: normal;
}

.auth-msg.warn strong {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.auth-conflict-list {
  margin: 0.35rem 0 0.5rem;
  padding-left: 1.1rem;
}

.auth-conflict-list li {
  margin: 0.15rem 0;
}

.auth-conflict-note {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  opacity: 0.92;
}

.auth-submit-warn {
  background: linear-gradient(180deg, #b7791f, #9a6414) !important;
}

.auth-switch {
  margin-top: 1.25rem;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}

.auth-switch a {
  color: var(--brand);
  font-weight: 650;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0 0 1.25rem;
  padding: 0;
  border: 1px solid rgba(10, 51, 64, 0.85);
  border-radius: 8px;
  background: var(--brand-deep);
  overflow: hidden;
}

.login-card .auth-mode-tab,
.auth-card .auth-mode-tab {
  appearance: none;
  width: auto;
  margin: 0;
  padding: 0.72rem 0.45rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.login-card .auth-mode-tab + .auth-mode-tab,
.auth-card .auth-mode-tab + .auth-mode-tab {
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.login-card .auth-mode-tab:hover,
.auth-card .auth-mode-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.login-card .auth-mode-tab.is-active,
.auth-card .auth-mode-tab.is-active {
  background: #fff;
  color: var(--brand-deep);
  box-shadow: none;
}

.login-card .auth-mode-tab.is-active:hover,
.auth-card .auth-mode-tab.is-active:hover {
  background: #fff;
  color: var(--brand-deep);
}

.auth-mode-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0 0 0.35rem;
  width: 100%;
}

.auth-mode-panel[hidden] {
  display: none !important;
}

.auth-mode-panel .hint {
  margin: 0;
  order: 2;
}

.auth-mode-panel .auth-row,
.auth-mode-panel > label {
  order: 1;
}

.login-card.auth-card .hint {
  margin: 0.1rem 0 0.85rem;
  font-size: 0.8rem;
  color: rgba(12, 18, 34, 0.52);
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
}

.login-card.auth-card .hint a {
  color: var(--brand);
  font-weight: 650;
  text-decoration: none;
  margin-left: 0.25rem;
}

.login-card.auth-card .hint a:hover {
  text-decoration: underline;
}

.login-card button {
    /*color: #222!important;*/
}

.auth-password-gate {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.auth-password-gate:disabled {
  opacity: 0.55;
}

.auth-password-gate:disabled input {
  cursor: not-allowed;
  background: rgba(245, 247, 251, 0.9);
}

.auth-card .foot {
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(15, 76, 92, 0.1);
}

.auth-card .foot a {
  color: var(--brand-deep);
  font-weight: 600;
  letter-spacing: 0.02em;
}

@keyframes auth-stage-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes auth-mark-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes auth-card-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes auth-seal-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  body.login-body {
    grid-template-columns: 1fr;
  }
  .login-stage {
    min-height: 34vh;
    justify-content: center;
  }
  .auth-row {
    grid-template-columns: 1fr;
  }
  .auth-row .otp-send {
    width: 100%;
  }
  .auth-card {
    padding: 1.4rem 1.25rem 1.4rem;
  }
  .auth-card::after {
    inset: 8px;
  }
}

/* ===== Terms-of-service checkbox (register & login) ===== */
.auth-card .terms-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.9rem 0 0.2rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  line-height: 1.45;
  cursor: pointer;
}

.auth-card .terms-check input {
  width: auto;
  height: auto;
  min-width: 1rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
  border: 1px solid #b7c3d4;
  border-radius: 4px;
  padding: 0;
  font-size: 1rem;
  accent-color: var(--brand);
  cursor: pointer;
}

.auth-card .terms-check a {
  color: var(--brand);
  text-decoration: underline;
}

/* ===== Public terms / privacy pages ===== */
body.login-body.terms-panel {
  display: block;
}

body.login-body.terms-panel .login-panel {
  max-width: 860px;
  margin: 3rem auto 4rem;
  align-items: stretch;
}

.terms-panel .auth-card {
  padding: 2.4rem 2.6rem;
  overflow-y: auto;
  max-height: 90vh;
}

.terms-panel .auth-card h1 {
  font-size: 1.5rem;
  margin-top: 0;
}

.terms-panel .auth-card h2 {
  font-size: 1.05rem;
  margin-top: 1.6rem;
  margin-bottom: 0.4rem;
  color: var(--ink-strong, #17354a);
}

.terms-panel .auth-card p,
.terms-panel .auth-card li {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.65;
  font-weight: 400;
}

.terms-panel .auth-card ul {
  margin: 0.3rem 0 0 1.1rem;
  padding: 0;
}

.terms-divider {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid #dbe3ee;
}

.login-card .auth-mode-tab, .auth-card .auth-mode-tab {
  color: rgba(255, 255, 255, 0.72);
}

/* ── Auth IDE gate (left panel) — aligned with home live code stage ── */
.auth-ide-stage {
  justify-content: flex-start;
  align-items: stretch;
  gap: 1.75rem;
  min-height: 100vh;
}

.auth-stage-overlay {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  max-width: 40rem;
  padding: 0.5rem 0 0.25rem;
  animation: auth-stage-in 0.85s ease both;
}

.auth-stage-overlay::before {
  content: "";
  position: absolute;
  inset: -2rem -1.5rem auto -1rem;
  height: 220px;
  background: radial-gradient(70% 100% at 20% 0%, rgba(176, 141, 87, 0.14), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.auth-stage-crest {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
  animation: auth-crest-in 0.9s ease 0.05s both;
}

.auth-crest-line {
  flex: 1;
  max-width: 4.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(215, 179, 122, 0.75), transparent);
}

.auth-crest-mark {
  font-size: 0.85rem;
  color: #d7b37a;
  text-shadow: 0 0 18px rgba(215, 179, 122, 0.45);
  line-height: 1;
}

.auth-stage-overlay .stage-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1rem;
  padding: 0.28rem 0.7rem 0.28rem 0;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: rgba(215, 179, 122, 0.95);
  text-transform: uppercase;
}

.auth-stage-overlay .stage-eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, #d7b37a, rgba(215, 179, 122, 0.2));
}

.auth-stage-overlay .mark {
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  margin: 0 0 0.55rem;
  line-height: 0.98;
  letter-spacing: 0.02em;
  animation: auth-mark-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.auth-stage-overlay .mark em {
  font-style: normal;
  background: linear-gradient(135deg, #e8c992 0%, #d7b37a 45%, #b08d57 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(176, 141, 87, 0.25));
}

.auth-stage-headline {
  margin: 0 0 0.65rem;
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.96);
  text-wrap: balance;
  animation: auth-headline-in 0.85s ease 0.14s both;
}

.auth-stage-rule {
  width: 3.2rem;
  height: 2px;
  margin: 0 0 1rem;
  border: 0;
  background: linear-gradient(90deg, #d7b37a, rgba(215, 179, 122, 0.15));
  animation: auth-rule-in 0.7s ease 0.2s both;
}

.auth-stage-overlay .lede {
  margin: 0 0 1.35rem;
  max-width: 42ch;
  font-size: 1.02rem;
  font-weight: 400;
  line-height: 1.82;
  letter-spacing: 0.02em;
  color: rgba(238, 243, 248, 0.78);
  animation: auth-lede-in 0.85s ease 0.22s both;
}

.auth-stage-pillars {
  list-style: none;
  margin: 0 0 1.35rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  animation: auth-pillars-in 0.85s ease 0.28s both;
}

.auth-stage-pillars li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.62rem 0.85rem;
  border-left: 2px solid rgba(215, 179, 122, 0.85);
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.08));
  backdrop-filter: blur(4px);
  color: rgba(238, 243, 248, 0.88);
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.auth-stage-pillars li:hover {
  background: linear-gradient(90deg, rgba(176, 141, 87, 0.12), rgba(0, 0, 0, 0.06));
  border-left-color: #e8c992;
}

.asp-num {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  color: #d7b37a;
  min-width: 1.6rem;
  flex-shrink: 0;
}

.asp-text {
  font-weight: 500;
  line-height: 1.4;
}

.auth-stage-overlay .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
  animation: auth-meta-in 0.85s ease 0.34s both;
}

.auth-stage-overlay .meta span {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.72rem;
  border: 1px solid rgba(176, 141, 87, 0.38);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  color: rgba(232, 236, 245, 0.62);
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-left: 0.72rem;
}

.auth-stage-overlay .meta span::before {
  display: none;
}

@keyframes auth-crest-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes auth-headline-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes auth-rule-in {
  from { opacity: 0; width: 0; }
  to { opacity: 1; width: 3.2rem; }
}

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

@keyframes auth-pillars-in {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes auth-meta-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.auth-code-stage {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  padding: 0 0 0.5rem;
}

.auth-code-window {
  width: min(100%, 540px);
  height: 400px;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 90% -10%, rgba(176, 141, 87, 0.16), transparent 50%),
    linear-gradient(155deg, #0a1828 0%, #0d1b2a 48%, #16283c 100%);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(176, 141, 87, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: auth-code-in 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.12s both;
}

@keyframes auth-code-in {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.acw-chrome {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.28);
}
.acw-dot { width: 9px; height: 9px; border-radius: 50%; }
.acw-dot-r { background: #e06c5a; }
.acw-dot-y { background: #d4a843; }
.acw-dot-g { background: #4caf7a; }
.acw-title {
  margin-left: 0.4rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: rgba(232, 236, 245, 0.55);
}
.acw-live {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #7ee8a8;
}
.acw-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7ee8a8;
  box-shadow: 0 0 8px rgba(126, 232, 168, 0.85);
  animation: acw-live-pulse 2.2s ease-in-out infinite;
}
@keyframes acw-live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.acw-scene {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: none;
}
/* In-place fade only — no translateY (prevents whole-page vertical jump) */
.acw-scene.is-scene-out {
  transition: opacity 0.55s ease;
  opacity: 0;
}
.acw-scene.is-scene-in {
  transition: opacity 0.55s ease;
  opacity: 0;
}
.acw-scene.is-scene-in.is-scene-ready {
  opacity: 1;
}

.acw-layout {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.acw-sidebar {
  padding: 0.55rem 0.45rem;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.18);
}
.acw-sidebar-head {
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.14em;
  color: rgba(232, 236, 245, 0.38);
  padding: 0.15rem 0.3rem 0.45rem;
}
.acw-tree {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}
.acw-tree-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  color: rgba(232, 236, 245, 0.52);
  padding: 0.24rem 0.3rem;
  border-radius: 4px;
}
.acw-tree-item.is-file { padding-left: 1rem; }
.acw-tree-item.is-active {
  background: rgba(176, 141, 87, 0.16);
  color: #f0dcc0;
}
.acw-ico { font-size: 0.52rem; opacity: 0.65; }

.acw-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.acw-tabs {
  flex: 0 0 auto;
}
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.12);
}
.acw-tab {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: #f0dcc0;
  padding: 0.4rem 0.7rem;
  border-bottom: 2px solid #b08d57;
}

.acw-editor-wrap {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.acw-gutter {
  padding: 0.65rem 0.3rem 0.65rem 0;
  text-align: right;
  font-family: var(--mono);
  font-size: 0.58rem;
  line-height: 1.45rem;
  color: rgba(232, 236, 245, 0.2);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  white-space: pre;
  user-select: none;
}
.acw-editor {
  margin: 0;
  padding: 0.65rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.45rem;
  color: rgba(232, 236, 245, 0.92);
  white-space: pre-wrap;
  overflow: auto;
  height: 100%;
}
.acw-editor code {
  display: block;
  white-space: pre-wrap;
}
.acw-cursor {
  display: inline-block;
  width: 2px;
  height: 0.95em;
  background: #b08d57;
  animation: acw-cursor-blink 1.4s step-end infinite;
  vertical-align: text-bottom;
}
@keyframes acw-cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.auth-code-window .tok-kw { color: #c792ea; }
.auth-code-window .tok-fn { color: #82aaff; }
.auth-code-window .tok-str { color: #c3e88d; }
.auth-code-window .tok-param { color: #f07178; }
.auth-code-window .tok-plain { color: rgba(232, 236, 245, 0.88); }

.acw-terminal {
  flex: 0 0 auto;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.acw-term-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  color: rgba(232, 236, 245, 0.42);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.acw-term-badge {
  font-size: 0.52rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(232, 236, 245, 0.5);
}
.acw-term-badge.is-running {
  color: #7ee8a8;
  border-color: rgba(126, 232, 168, 0.35);
}
.acw-term-badge.is-done {
  color: #d7b37a;
  border-color: rgba(176, 141, 87, 0.4);
}
.acw-term-body {
  height: 72px;
  max-height: 72px;
  overflow-y: auto;
  padding: 0.5rem 0.75rem 0.65rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  line-height: 1.55;
}
.acw-log { animation: acw-log-in 0.5s ease both; }
@keyframes acw-log-in {
  from { opacity: 0; transform: translateX(-5px); }
  to { opacity: 1; transform: translateX(0); }
}
.acw-log-cmd { color: #82aaff; }
.acw-log-ok { color: #7ee8a8; }
.acw-log-info { color: rgba(232, 236, 245, 0.62); }

.acw-chrome,
.acw-statusbar {
  flex: 0 0 auto;
}
.acw-statusbar {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.55rem;
  color: rgba(232, 236, 245, 0.48);
  background: rgba(0, 0, 0, 0.22);
}
.acw-status-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b08d57;
  margin-right: 0.3rem;
  font-style: normal;
  vertical-align: middle;
}

@media (max-width: 900px) {
  .auth-ide-stage {
    min-height: auto;
    padding-bottom: 1.5rem;
  }
  .auth-stage-overlay {
    max-width: none;
    padding-bottom: 0.5rem;
  }
  .auth-stage-overlay .mark {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }
  .auth-stage-headline {
    font-size: clamp(1.15rem, 4.5vw, 1.45rem);
  }
  .auth-stage-pillars li {
    padding: 0.5rem 0.7rem;
    font-size: 0.86rem;
  }
  .auth-code-window {
    height: 360px;
  }
  .acw-layout {
    grid-template-columns: 1fr;
  }
  .acw-sidebar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-code-window,
  .acw-live-dot,
  .acw-cursor {
    animation: none !important;
  }
  .acw-scene.is-scene-out,
  .acw-scene.is-scene-in,
  .acw-scene.is-scene-in.is-scene-ready {
    transition: none !important;
    opacity: 1 !important;
  }
}
