:root {
  --bg: #070b12;
  --panel: rgba(14, 20, 31, 0.92);
  --panel-line: rgba(148, 163, 184, 0.16);
  --text: #f3f7fb;
  --muted: #93a2b7;
  --cyan: #4fd1c5;
  --cyan-bright: #80fff2;
  --amber: #f4b942;
  --danger: #ff7a86;
  --success: #64e2ad;
  --input: #0a101a;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.44);
  --scene-x: 0px;
  --scene-y: 0px;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  isolation: isolate;
  background: #05080d;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0.13;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, black, transparent 90%);
}

.cinematic-backdrop {
  position: fixed;
  z-index: 0;
  inset: 0;
  background-image: url("/assets/gundi-heroes.webp");
  background-size: cover;
  background-position: 44% center;
  filter: saturate(1.12) contrast(1.04);
  transform: translate3d(var(--scene-x), var(--scene-y), 0) scale(1.045);
  transition: transform 700ms cubic-bezier(.2,.75,.2,1);
  will-change: transform;
}

.scene-vignette {
  position: fixed;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(3, 6, 11, 0.12) 0%, rgba(3, 6, 11, 0.18) 40%, rgba(3, 6, 11, 0.62) 72%, rgba(3, 6, 11, 0.86) 100%),
    linear-gradient(180deg, rgba(3, 7, 13, 0.48) 0%, transparent 24%, transparent 58%, rgba(3, 6, 10, 0.88) 100%);
}

.storm-flash {
  position: fixed;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  background:
    radial-gradient(ellipse at 74% 9%, rgba(190, 231, 255, .46), transparent 18%),
    linear-gradient(110deg, transparent 42%, rgba(133, 208, 255, .15) 51%, transparent 58%);
}

.storm-flash.is-active { animation: storm-pulse 820ms ease-out; }

@keyframes storm-pulse {
  0%, 100% { opacity: 0; }
  8% { opacity: .72; }
  15% { opacity: .08; }
  26% { opacity: .42; }
  44% { opacity: 0; }
}

.embers {
  position: fixed;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.embers i {
  position: absolute;
  bottom: -20px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #ffb13b;
  box-shadow: 0 0 12px 3px rgba(255, 92, 28, 0.72);
  opacity: 0;
  animation: ember-rise 7s linear infinite;
}

.embers i:nth-child(1) { left: 8%; animation-delay: 0s; }
.embers i:nth-child(2) { left: 23%; animation-delay: 2.4s; animation-duration: 8.5s; }
.embers i:nth-child(3) { left: 43%; animation-delay: 1.1s; animation-duration: 6.8s; }
.embers i:nth-child(4) { left: 57%; animation-delay: 4.2s; }
.embers i:nth-child(5) { left: 76%; animation-delay: 2.8s; animation-duration: 9s; }
.embers i:nth-child(6) { left: 91%; animation-delay: .6s; animation-duration: 7.6s; }

@keyframes ember-rise {
  0% { opacity: 0; transform: translate3d(0, 0, 0) scale(.7); }
  12% { opacity: .9; }
  70% { opacity: .45; }
  100% { opacity: 0; transform: translate3d(34px, -72vh, 0) scale(1.3); }
}

button, input { font: inherit; }
button { color: inherit; }

.ambient {
  position: fixed;
  z-index: 2;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.11;
  pointer-events: none;
}

.ambient-one { top: -210px; right: 18%; background: var(--cyan); }
.ambient-two { bottom: -280px; left: 8%; background: #ff542f; }

.site-header {
  position: relative;
  z-index: 5;
  width: min(1160px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.72);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.12em;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(79, 209, 197, 0.58);
  transform: rotate(45deg);
  color: var(--cyan-bright);
  background: rgba(79, 209, 197, 0.06);
  font-family: Georgia, serif;
  font-size: 1.28rem;
  font-weight: 700;
  box-shadow: inset 0 0 18px rgba(79, 209, 197, 0.1);
}

.brand-mark::first-letter { transform: rotate(-45deg); }
.brand > span:last-child { display: grid; gap: 2px; }
.brand strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.06rem; }
.brand small { color: var(--muted); font-size: 0.62rem; letter-spacing: 0.16em; }

.server-state {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(7, 11, 18, 0.6);
  font-size: 0.76rem;
}

.state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 12px currentColor;
}

.server-state.is-online { color: var(--success); }
.server-state.is-online .state-dot { background: var(--success); }
.server-state.is-offline { color: var(--amber); }

main {
  position: relative;
  z-index: 5;
  width: min(1160px, calc(100% - 48px));
  margin: 0 auto;
  min-height: calc(100vh - 168px);
  padding: 42px 0 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(370px, 460px);
  align-items: stretch;
  gap: clamp(54px, 8vw, 120px);
}

.intro {
  align-self: end;
  max-width: 690px;
  padding: 34px 30px 34px 0;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.75));
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.19em;
}

.eyebrow span { width: 34px; height: 1px; background: var(--cyan); }

.intro h1 {
  margin: 0;
  max-width: 680px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.15rem, 5.2vw, 5rem);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.05em;
  text-wrap: balance;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.82), 0 1px 0 rgba(255,255,255,.08);
}

.intro h1::first-line { color: #fff; }

.intro-copy {
  max-width: 530px;
  margin: 28px 0 30px;
  color: #dae3ee;
  font-size: 1.03rem;
  line-height: 1.75;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.9);
}

.class-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -10px 0 22px;
}

.class-line span {
  border: 1px solid currentColor;
  padding: 5px 9px;
  background: rgba(3, 7, 12, 0.66);
  box-shadow: inset 0 0 14px rgba(255,255,255,.03), 0 4px 14px rgba(0,0,0,.34);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.class-warrior { color: #ff795d; }
.class-sura { color: #c58aff; }
.class-shaman { color: #64eee0; }
.class-ninja { color: #79b8ff; }

.trust-list { display: flex; flex-wrap: wrap; gap: 10px 22px; color: #c2cedb; font-size: 0.78rem; text-shadow: 0 2px 10px #000; }
.trust-list span { display: inline-flex; align-items: center; gap: 7px; }
.trust-list i { color: var(--cyan); font-style: normal; }

.auth-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 34px;
  border: 1px solid rgba(213, 173, 91, 0.76);
  background:
    linear-gradient(155deg, rgba(26, 24, 25, 0.92), rgba(7, 9, 13, 0.97) 62%),
    radial-gradient(circle at 50% -15%, rgba(194, 59, 31, 0.28), transparent 42%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 1px, transparent 1px 5px);
  box-shadow:
    inset 0 0 55px rgba(0, 0, 0, 0.78),
    inset 0 1px 0 rgba(255, 226, 151, 0.18),
    0 0 0 5px rgba(4, 6, 9, 0.72),
    0 36px 100px rgba(0, 0, 0, 0.72),
    0 0 54px rgba(177, 64, 31, 0.14);
  backdrop-filter: blur(24px) saturate(1.18);
  clip-path: polygon(0 14px, 14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px));
  transform: perspective(1100px) rotateX(var(--card-rx, 0deg)) rotateY(var(--card-ry, 0deg));
  transform-style: preserve-3d;
  transition: transform 220ms ease, box-shadow 220ms ease;
  will-change: transform;
}

.auth-card::before,
.auth-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.auth-card::before {
  z-index: -1;
  inset: 7px;
  border: 1px solid rgba(213, 173, 91, 0.2);
  background:
    radial-gradient(circle at var(--glow-x, 50%) var(--glow-y, 20%), rgba(255, 183, 84, .095), transparent 25%),
    radial-gradient(circle at 50% 0%, rgba(255, 115, 44, .1), transparent 34%),
    linear-gradient(90deg, transparent, rgba(229, 191, 107, .045), transparent);
  transition: background-position 180ms ease;
}

.auth-card::after {
  z-index: 4;
  inset: 0;
  border-left: 3px solid rgba(96, 230, 220, .68);
  border-right: 3px solid rgba(255, 105, 50, .66);
  clip-path: polygon(0 0, 34px 0, 34px 2px, 2px 2px, 2px 44px, 0 44px, 0 100%, 100% 100%, 100% calc(100% - 44px), calc(100% - 2px) calc(100% - 44px), calc(100% - 2px) calc(100% - 2px), calc(100% - 34px) calc(100% - 2px), calc(100% - 34px) 100%, 0 100%);
}

.auth-card > *:not(.panel-runes) { position: relative; z-index: 2; }

.panel-runes {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
}

.panel-runes::before,
.panel-runes::after {
  content: "";
  position: absolute;
  width: 270px;
  height: 270px;
  border: 1px solid rgba(203, 164, 82, .08);
  transform: rotate(45deg);
}

.panel-runes::after { width: 205px; height: 205px; border-color: rgba(93, 224, 214, .06); }

.panel-runes span {
  color: rgba(220, 176, 83, .035);
  font-family: Georgia, serif;
  font-size: 17rem;
  font-weight: 700;
  text-shadow: 0 0 50px rgba(202, 76, 37, .08);
  transform: rotate(-8deg);
}

.ornament-line {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: -7px 5px 16px;
  color: #d7ae58;
}

.ornament-line i { height: 1px; background: linear-gradient(90deg, transparent, rgba(215, 174, 88, .7)); }
.ornament-line i:last-child { background: linear-gradient(90deg, rgba(215, 174, 88, .7), transparent); }
.ornament-line b { font-size: .72rem; text-shadow: 0 0 12px #f07838; }

.auth-shell { align-self: center; }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(191, 151, 74, 0.38);
  background: linear-gradient(#090b0f, #111015);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, .85), 0 8px 24px rgba(0,0,0,.28);
}

.tab {
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  padding: 12px 10px;
  color: #9e9aa0;
  background: linear-gradient(180deg, rgba(255,255,255,.025), transparent);
  cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: .035em;
  text-shadow: 0 2px 6px #000;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.tab span { margin-right: 5px; color: #d9b96d; }
.tab:hover { color: #ffe6ae; border-color: rgba(210, 165, 75, .24); }
.tab.is-active {
  color: #ffe8b3;
  border-color: #c99743;
  background: linear-gradient(180deg, #9f3926 0%, #681c17 48%, #350d0c 100%);
  box-shadow: inset 0 1px 0 rgba(255, 221, 135, .32), inset 0 -8px 18px rgba(0,0,0,.34), 0 0 18px rgba(224, 68, 32, .2);
  text-shadow: 0 1px 0 #250604, 0 0 12px rgba(255, 178, 81, .52);
}
.tab:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid #e0b45d; outline-offset: 2px; }

.auth-form { display: grid; gap: 17px; padding-top: 28px; }
.form-heading { margin-bottom: 2px; }
.form-kicker { display: block; margin-bottom: 5px; color: #c89a48; font-size: .61rem; font-weight: 800; letter-spacing: .22em; text-shadow: 0 0 10px rgba(224, 112, 44, .4); }
.form-heading h2 {
  width: fit-content;
  margin: 0 0 7px;
  color: #f4d78f;
  background: linear-gradient(180deg, #fff4ca 0%, #e6bd67 58%, #9f682b 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.78rem;
  font-weight: 700;
  letter-spacing: .01em;
  text-shadow: 0 3px 14px rgba(229, 119, 49, .16);
  filter: drop-shadow(0 2px 1px rgba(0,0,0,.82));
}
.form-heading p { margin: 0; color: #aaa5a2; font-size: 0.84rem; }

.field { display: grid; gap: 7px; }
.field label { color: #d6bb7b; font-size: 0.73rem; font-weight: 800; letter-spacing: 0.065em; text-transform: uppercase; text-shadow: 0 1px 5px #000; }

.field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(164, 131, 70, 0.42);
  border-radius: 0;
  padding: 11px 13px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(4, 6, 9, .92), rgba(15, 14, 15, .96)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.02) 0 1px, transparent 1px 4px);
  box-shadow: inset 0 2px 12px rgba(0,0,0,.72), inset 0 1px 0 rgba(255,255,255,.025);
  caret-color: #efbe61;
  transition: border 160ms ease, box-shadow 160ms ease;
}

.field input:hover { border-color: rgba(216, 174, 87, 0.62); }
.field input:focus { border-color: #dbad56; box-shadow: inset 0 2px 12px rgba(0,0,0,.72), 0 0 0 2px rgba(215, 168, 76, 0.09), 0 0 18px rgba(238, 113, 45, .1); }
.field:focus-within label { color: #ffe1a0; text-shadow: 0 0 10px rgba(232, 127, 53, .44); }
.field input[aria-invalid="true"] { border-color: rgba(255, 122, 134, 0.72); }
.field input::placeholder { color: #625e5c; }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 72px; }
.reveal { position: absolute; right: 7px; top: 7px; height: 32px; border: 0; padding: 0 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: 0.72rem; }
.reveal:hover { color: var(--cyan-bright); }

.field-hint, .field-error { min-height: 0; color: var(--muted); font-size: 0.69rem; line-height: 1.45; }
.field-error:not(:empty) { color: var(--danger); }
.field-error.standalone { margin-top: -10px; }

.password-rules { display: flex; flex-wrap: wrap; gap: 6px 12px; color: #657286; font-size: 0.67rem; }
.password-rules span::before { content: "○"; margin-right: 4px; }
.password-rules span.is-met { color: var(--success); }
.password-rules span.is-met::before { content: "✓"; }

.check-row { display: grid; grid-template-columns: 17px 1fr; gap: 9px; align-items: start; color: var(--muted); font-size: 0.73rem; line-height: 1.55; cursor: pointer; }
.check-row input { width: 15px; height: 15px; margin: 2px 0 0; accent-color: var(--cyan); }

.primary-button {
  position: relative;
  overflow: hidden;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #d5a84e;
  padding: 0 18px;
  color: #ffe9b7;
  background: linear-gradient(180deg, #b24429 0%, #7d2118 45%, #3c0d0b 100%);
  box-shadow: inset 0 1px 0 rgba(255, 229, 151, .34), inset 0 -10px 20px rgba(0,0,0,.3), 0 12px 30px rgba(111, 27, 19, .4), 0 0 24px rgba(232, 93, 38, .12);
  cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-shadow: 0 2px 2px #260705, 0 0 10px rgba(255, 188, 87, .44);
  transition: transform 160ms ease, filter 160ms ease;
}

.primary-button::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 20%, rgba(255,237,183,.18) 48%, transparent 76%); transform: translateX(-120%); transition: transform .55s ease; }
.primary-button:hover { filter: brightness(1.12); transform: translateY(-1px); }
.primary-button:hover::before { transform: translateX(120%); }
.primary-button span { position: relative; z-index: 1; }
.primary-button span:last-child { color: #ffd780; text-shadow: 0 0 10px #ff743a; }
.primary-button:hover span:last-child { animation: weapon-glow 900ms ease-in-out infinite alternate; }
.primary-button:disabled { cursor: default; opacity: 0.72; transform: none; }
.primary-button:disabled:hover { filter: none; }
.primary-button:disabled:hover::before { transform: translateX(-120%); }
.preview-form input:disabled { opacity: 0.75; cursor: default; }
.preview-form .reveal:disabled { cursor: default; }
.preview-note { margin: 18px 0 0; padding: 12px 14px; border: 1px solid rgba(210, 165, 75, .4); color: #f2d99a; background: rgba(123, 74, 28, .18); font-size: .88rem; line-height: 1.5; }

@keyframes weapon-glow {
  from { transform: scale(.94) rotate(-5deg); filter: brightness(1); }
  to { transform: scale(1.12) rotate(5deg); filter: brightness(1.45); }
}

.magic-ripple {
  position: absolute !important;
  z-index: 0 !important;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 1px solid rgba(255, 225, 146, .9);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 183, 72, .32), transparent 68%);
  box-shadow: 0 0 18px rgba(255, 104, 45, .58);
  pointer-events: none;
  animation: magic-ripple 650ms ease-out forwards;
}

@keyframes magic-ripple {
  from { opacity: .95; transform: scale(.4); }
  to { opacity: 0; transform: scale(15); }
}

.privacy-note { display: flex; gap: 8px; margin: 22px 0 0; padding-top: 18px; border-top: 1px solid rgba(191, 151, 74, 0.2); color: #77716d; font-size: 0.66rem; line-height: 1.5; }
.privacy-note span { color: #d4a64f; text-shadow: 0 0 9px rgba(238, 111, 42, .48); }

.form-alert { margin-top: 20px; border: 1px solid rgba(255, 122, 134, 0.28); padding: 11px 13px; color: #ffb2ba; background: rgba(255, 122, 134, 0.07); font-size: 0.76rem; line-height: 1.5; }
.form-alert.is-success { border-color: rgba(100, 226, 173, 0.34); color: var(--success); background: rgba(100, 226, 173, 0.07); }

footer {
  position: relative;
  z-index: 5;
  width: min(1160px, calc(100% - 48px));
  margin: 0 auto;
  padding: 22px 0 28px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  color: #8d9aac;
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-shadow: 0 2px 8px #000;
}

[hidden] { display: none !important; }

@media (max-width: 880px) {
  .cinematic-backdrop { background-position: 30% top; }
  .scene-vignette {
    background:
      linear-gradient(180deg, rgba(3, 6, 11, .16) 0%, rgba(3, 6, 11, .25) 30%, rgba(3, 6, 11, .92) 64%, #05080d 100%);
  }
  main { grid-template-columns: 1fr; min-height: auto; padding-top: 300px; gap: 28px; }
  .intro { text-align: center; padding-bottom: 6px; }
  .eyebrow { justify-content: center; }
  .intro h1 { margin-inline: auto; font-size: clamp(3.1rem, 11.6vw, 5.6rem); }
  .intro-copy { margin-inline: auto; }
  .trust-list { justify-content: center; }
  .class-line { justify-content: center; }
  .auth-shell { width: min(100%, 510px); margin: 0 auto; }
}

@media (max-width: 560px) {
  .site-header, main, footer { width: min(100% - 28px, 1160px); }
  .site-header { padding: 20px 0; }
  .server-state span:last-child { display: none; }
  .server-state { padding: 9px; }
  main { padding: 260px 0 44px; }
  .intro h1 { font-size: clamp(2.75rem, 14vw, 4.2rem); }
  .intro-copy { font-size: 0.93rem; }
  .trust-list { display: grid; justify-items: start; width: fit-content; margin: 0 auto; }
  .auth-card { padding: 20px; }
  footer { gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .embers i, .storm-flash, .primary-button span:last-child { animation: none !important; }
  .cinematic-backdrop, .auth-card { transform: none !important; }
}
