:root {
  color-scheme: dark;
  --ink: #041323;
  --ink-soft: #092640;
  --panel: #071e33;
  --cyan: #3edcf4;
  --cyan-bright: #7df1ff;
  --ice: #eefcff;
  --muted: #96adbd;
  --line: rgb(126 223 247 / 20%);
  --danger: #ff7180;
  --success: #54e6a0;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--ice);
  font-family: Inter, ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
a { color: inherit; }

.auth-shell { min-height: 100dvh; display: grid; grid-template-columns: minmax(420px, .92fr) minmax(520px, 1.08fr); }
.auth-scene { position: relative; min-height: 100dvh; overflow: hidden; isolation: isolate; background: #0874ac; }
.auth-scene::before { content: ""; position: absolute; z-index: 2; inset: 0; background: linear-gradient(180deg, rgb(1 15 28 / 25%), rgb(1 20 36 / 10%) 40%, rgb(3 18 31 / 86%)), linear-gradient(90deg, rgb(3 21 37 / 34%), transparent 70%); pointer-events: none; }
.auth-scene::after { content: ""; position: absolute; z-index: 3; inset: 0; border: 1px solid rgb(125 237 255 / 12%); pointer-events: none; }
.auth-brand { position: absolute; z-index: 5; top: 28px; left: 34px; display: inline-flex; align-items: center; text-decoration: none; }
.auth-brand img { width: 220px; height: auto; display: block; filter: drop-shadow(0 14px 30px rgb(0 0 0 / 28%)); }
.auth-scene__art { position: absolute; z-index: 1; inset: 0; }
.auth-scene__art img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.05); }
.auth-scene__copy { position: absolute; z-index: 4; left: 42px; right: 42px; bottom: 120px; max-width: 560px; }
.auth-scene__copy > p { margin: 0 0 16px; display: flex; align-items: center; gap: 8px; color: var(--cyan-bright); font-size: 11px; font-weight: 900; letter-spacing: .18em; }
.auth-scene__copy > p i { width: 8px; height: 8px; border-radius: 50%; background: #4ae99d; box-shadow: 0 0 14px #4ae99d; }
.auth-scene__copy h1 { margin: 0; font-size: clamp(3.2rem, 6vw, 6.1rem); line-height: .88; letter-spacing: -.075em; text-shadow: 0 12px 36px rgb(0 0 0 / 38%); }
.auth-scene__copy h1 em { color: var(--cyan-bright); font-style: normal; }
.auth-scene__copy > span { display: block; max-width: 470px; margin-top: 23px; color: rgb(235 250 255 / 78%); font-size: 17px; line-height: 1.55; }
.auth-scene__metric { position: absolute; z-index: 5; right: 30px; bottom: 30px; padding: 14px 16px; border: 1px solid rgb(255 255 255 / 20%); border-radius: 16px; background: rgb(3 24 40 / 62%); backdrop-filter: blur(14px); }
.auth-scene__metric small { display: block; color: var(--cyan-bright); font-size: 8px; font-weight: 900; letter-spacing: .15em; }
.auth-scene__metric strong { display: block; margin-top: 3px; font-size: 12px; }

.auth-panel { position: relative; min-height: 100dvh; padding: 40px clamp(28px, 7vw, 104px); display: grid; align-items: center; background: radial-gradient(circle at 100% 0, rgb(30 184 229 / 11%), transparent 28rem), var(--ink); }
.auth-panel::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .22; background-image: linear-gradient(rgb(109 211 239 / 5%) 1px, transparent 1px), linear-gradient(90deg, rgb(109 211 239 / 5%) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(90deg, transparent, #000); }
.auth-back { position: absolute; z-index: 2; top: 32px; right: 40px; display: inline-flex; align-items: center; gap: 8px; color: #9ab5c7; font-size: 13px; font-weight: 700; text-decoration: none; }
.auth-back span { color: var(--cyan); font-size: 19px; }
.auth-panel__inner { position: relative; z-index: 1; width: min(100%, 510px); margin: 44px auto 20px; }
.auth-panel__inner--register { width: min(100%, 650px); }
.auth-kicker { margin: 0 0 12px; color: var(--cyan); font-size: 11px; font-weight: 900; letter-spacing: .18em; }
.auth-panel h2 { margin: 0; font-size: clamp(2.15rem, 4vw, 3.7rem); line-height: 1; letter-spacing: -.06em; }
.auth-lead { margin: 13px 0 30px; color: var(--muted); font-size: 16px; }
.auth-form { display: grid; gap: 18px; }
.auth-form--register { grid-template-columns: 1fr 1fr; column-gap: 14px; }
.auth-field { display: grid; gap: 8px; }
.auth-field--wide { grid-column: 1 / -1; }
.auth-field label { color: #c8dbe7; font-size: 13px; font-weight: 800; }
.auth-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-label-row span { color: #718d9f; font-size: 11px; }
.auth-input { position: relative; min-height: 57px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 16px; background: rgb(8 35 58 / 74%); box-shadow: inset 0 1px rgb(255 255 255 / 3%); transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.auth-input:focus-within { border-color: rgb(84 225 248 / 72%); background: rgb(9 42 69 / 88%); box-shadow: 0 0 0 4px rgb(62 220 244 / 9%); }
.auth-input > svg { flex: 0 0 auto; width: 20px; height: 20px; margin-left: 17px; fill: none; stroke: #6c91a8; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-input input { width: 100%; min-width: 0; height: 55px; padding: 0 15px; border: 0; outline: 0; background: transparent; color: #fff; font-size: 15px; }
.auth-input input::placeholder { color: #557389; }
.auth-input button { flex: 0 0 auto; width: 48px; height: 48px; margin-right: 4px; display: grid; place-items: center; border: 0; background: transparent; color: #7696aa; cursor: pointer; }
.auth-input button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.auth-field > small { min-height: 0; color: var(--danger); font-size: 11px; line-height: 1.35; }
.auth-field.is-invalid .auth-input { border-color: rgb(255 113 128 / 75%); box-shadow: 0 0 0 4px rgb(255 113 128 / 7%); }
.auth-check { display: flex; align-items: flex-start; gap: 10px; color: #9bb1c0; font-size: 12px; line-height: 1.5; cursor: pointer; }
.auth-check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--cyan); }
.auth-submit { width: 100%; min-height: 58px; padding: 0 21px; display: flex; align-items: center; justify-content: space-between; border: 1px solid rgb(135 243 255 / 42%); border-radius: 16px; background: linear-gradient(135deg, var(--cyan-bright), var(--cyan) 52%, #1bb8ec); color: #032039; font-weight: 950; cursor: pointer; box-shadow: 0 16px 34px rgb(34 200 235 / 22%), inset 0 1px rgb(255 255 255 / 58%); transition: transform .2s ease, opacity .2s ease; }
.auth-submit:hover { transform: translateY(-2px); }
.auth-submit:disabled { opacity: .58; cursor: wait; transform: none; }
.auth-submit svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.auth-submit.is-loading svg { animation: auth-spin .8s linear infinite; }
.auth-message { padding: 13px 15px; border: 1px solid rgb(255 113 128 / 28%); border-radius: 13px; background: rgb(255 113 128 / 8%); color: #ffadb6; font-size: 12px; line-height: 1.45; }
.auth-message.is-success { border-color: rgb(84 230 160 / 30%); background: rgb(84 230 160 / 8%); color: #78efb5; }
.auth-switch { margin: 25px 0 0; color: #829eaf; font-size: 13px; text-align: center; }
.auth-switch a { color: var(--cyan-bright); font-weight: 850; text-decoration: none; }
.auth-security { margin: 30px 0 0; padding-top: 22px; display: flex; align-items: center; justify-content: center; gap: 8px; border-top: 1px solid var(--line); color: #668499; font-size: 11px; text-align: center; }
.auth-security svg { width: 17px; height: 17px; fill: none; stroke: #4fdc9d; stroke-width: 1.8; }
.password-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; align-items: center; }
.password-meter i { height: 3px; border-radius: 999px; background: #173d56; }
.password-meter span { grid-column: 1 / -1; color: #69889c; font-size: 10px; }
.password-meter[data-strength="1"] i:nth-child(-n+1) { background: #ff7180; }
.password-meter[data-strength="2"] i:nth-child(-n+2) { background: #ffc453; }
.password-meter[data-strength="3"] i:nth-child(-n+3) { background: #3edcf4; }
.password-meter[data-strength="4"] i { background: #54e6a0; }

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

@media (max-width: 1020px) {
  .auth-shell { grid-template-columns: minmax(330px, .75fr) minmax(500px, 1.25fr); }
  .auth-scene__copy h1 { font-size: 4.4rem; }
  .auth-scene__metric { display: none; }
}

@media (max-width: 820px) {
  .auth-shell { display: block; }
  .auth-scene { min-height: 320px; height: 39dvh; }
  .auth-brand { top: 14px; left: 18px; }
  .auth-brand img { width: 174px; }
  .auth-scene__copy { left: 24px; right: 24px; bottom: 32px; }
  .auth-scene__copy > p { margin-bottom: 10px; font-size: 9px; }
  .auth-scene__copy h1 { font-size: clamp(3rem, 14vw, 4.5rem); }
  .auth-scene__copy > span { display: none; }
  .auth-panel { min-height: 61dvh; padding: 68px 24px 34px; align-items: start; }
  .auth-back { top: 22px; right: 24px; }
  .auth-panel__inner { margin: 0 auto; }
}

@media (max-width: 620px) {
  body { overflow-x: hidden; }
  .auth-shell, .auth-scene, .auth-panel, .auth-panel__inner { width: 100%; min-width: 0; max-width: 100%; }
  .auth-scene { min-height: 280px; height: 36dvh; }
  .auth-panel { min-height: 64dvh; padding-inline: 18px; }
  .auth-panel h2 { font-size: 2.35rem; }
  .auth-lead { margin-bottom: 24px; font-size: 14px; }
  .auth-form--register { grid-template-columns: 1fr; }
  .auth-field--wide { grid-column: auto; }
  .auth-scene__copy h1 { max-width: 100%; font-size: clamp(2.75rem, 14.5vw, 3.35rem); overflow-wrap: anywhere; }
  .auth-input, .auth-input input, .auth-submit { max-width: 100%; }
}

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