:root {
  color: #f6f3fb;
  background: #0b0911;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -20%, rgba(98, 53, 145, 0.24), transparent 42%),
    linear-gradient(180deg, #0f0c17 0%, #09070e 100%);
}

button, input { font: inherit; }

.ambient {
  position: fixed;
  z-index: 0;
  width: 22rem;
  height: 22rem;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.15;
  pointer-events: none;
}

.ambient-one { top: 8%; left: -10rem; background: #7b3fc4; }
.ambient-two { right: -12rem; bottom: 2%; background: #12d99a; opacity: 0.08; }

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(100% - 32px, 540px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  color: #f9f7ff;
  font-size: 17px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.brand-logo-wrap {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(154, 110, 248, 0.38);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.2), rgba(32, 226, 165, 0.08));
  box-shadow: 0 12px 28px rgba(70, 39, 119, 0.2), inset 0 1px rgba(255, 255, 255, 0.06);
}

.brand-logo {
  display: block;
  width: 27px;
  height: 27px;
  object-fit: contain;
}

.brand-name {
  text-shadow: 0 0 24px rgba(139, 92, 246, 0.2);
}

.auth-card {
  align-self: center;
  margin: 40px 0;
  padding: clamp(24px, 6vw, 38px);
  border: 1px solid rgba(205, 191, 226, 0.14);
  border-radius: 24px;
  background: linear-gradient(155deg, rgba(27, 22, 38, 0.96), rgba(17, 14, 24, 0.97));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38), inset 0 1px rgba(255, 255, 255, 0.03);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: #49e5b4;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: #2ce3aa;
  box-shadow: 0 0 0 4px rgba(44, 227, 170, 0.1), 0 0 18px rgba(44, 227, 170, 0.5);
}

h1 {
  margin: 0;
  color: #fbfaff;
  font-size: clamp(30px, 7vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.lead {
  margin: 18px 0 28px;
  color: #b9b2c5;
  font-size: 16px;
  line-height: 1.65;
}

form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
label, legend { color: #e9e5ef; font-size: 14px; font-weight: 650; }
legend { margin-bottom: 8px; padding: 0; }

input {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid #3a3445;
  border-radius: 12px;
  outline: none;
  color: #f8f6fb;
  background: #100d16;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input::placeholder { color: #716a7d; }
input:hover { border-color: #50475f; }
input:focus { border-color: #25dca4; box-shadow: 0 0 0 3px rgba(37, 220, 164, 0.12); background: #121019; }
input[aria-invalid="true"] { border-color: #f07d8c; box-shadow: 0 0 0 3px rgba(240, 125, 140, 0.1); }

.code-inputs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) 12px repeat(4, minmax(0, 1fr));
  gap: clamp(5px, 1.7vw, 8px);
  align-items: center;
}

.code-inputs input {
  min-width: 0;
  min-height: 54px;
  padding: 0;
  text-align: center;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: clamp(17px, 4.8vw, 21px);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.code-separator { color: #756d81; font-size: 19px; text-align: center; }

.hint { color: #837b90; font-size: 12px; line-height: 1.45; }

.primary-button, .secondary-button {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 740;
  transition: transform 140ms ease, filter 140ms ease, border-color 140ms ease;
}

.primary-button {
  margin-top: 4px;
  border: 0;
  color: #06130f;
  background: linear-gradient(100deg, #18d79b, #35e9b2);
  box-shadow: 0 12px 30px rgba(24, 215, 155, 0.16);
}

.secondary-button { border: 1px solid #3c3548; color: #c9c2d2; background: transparent; }
.primary-button:hover, .secondary-button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.primary-button:focus-visible, .secondary-button:focus-visible { outline: 3px solid rgba(65, 231, 179, 0.35); outline-offset: 3px; }
.primary-button:disabled, .secondary-button:disabled { cursor: not-allowed; filter: grayscale(0.35); opacity: 0.58; transform: none; }

.form-status { min-height: 22px; margin: -4px 0 0; color: #a9a1b5; font-size: 13px; line-height: 1.5; }
.form-status[data-state="success"] { color: #5ce9bd; }
.form-status[data-state="error"] { color: #f095a1; }

.trust-note, .warning-panel {
  display: flex;
  gap: 12px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(205, 191, 226, 0.1);
}

.trust-note p { margin: 0; color: #8f879b; font-size: 12px; line-height: 1.55; }
.shield { display: grid; flex: 0 0 23px; height: 23px; place-items: center; border-radius: 8px; color: #3fe5b0; background: rgba(42, 222, 166, 0.09); font-size: 12px; }

footer { align-self: end; color: #686172; font-size: 11px; text-align: center; }

.confirm-card { text-align: center; }
.confirm-card .eyebrow { justify-content: center; }
.confirm-icon { display: grid; width: 54px; height: 54px; margin: 0 auto 20px; place-items: center; border: 1px solid rgba(45, 227, 171, 0.3); border-radius: 18px; color: #4ce6b6; background: rgba(40, 222, 166, 0.08); font-size: 22px; }
.confirm-icon[data-state="error"] { border-color: rgba(240, 125, 140, 0.35); color: #f095a1; background: rgba(240, 125, 140, 0.08); }
.confirm-icon[data-state="success"] { box-shadow: 0 0 32px rgba(44, 227, 170, 0.12); }
.warning-panel { display: grid; gap: 5px; padding: 15px; border: 1px solid rgba(226, 191, 117, 0.17); border-radius: 12px; color: #d4c49d; background: rgba(179, 134, 47, 0.06); text-align: left; }
.warning-panel strong { font-size: 13px; }
.warning-panel span { color: #a79a7d; font-size: 12px; line-height: 1.5; }
.button-stack { display: grid; gap: 10px; margin-top: 22px; }

@media (max-width: 540px) {
  .shell { width: min(100% - 20px, 540px); padding-top: 18px; }
  .auth-card { margin: 26px 0; border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
