:root {
  --bg: #040a13;
  --bg-soft: #081322;
  --panel: rgba(5, 12, 23, 0.86);
  --panel-strong: rgba(8, 17, 31, 0.94);
  --panel-border: rgba(129, 165, 230, 0.14);
  --line: rgba(145, 170, 214, 0.11);
  --line-strong: rgba(146, 179, 238, 0.2);
  --text: #f7faff;
  --muted: #9aaac3;
  --primary: #2e7dff;
  --primary-2: #8cc3ff;
  --electric: #2f86ff;
  --danger: #ff7b72;
  --success: #39d89a;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 16% 12%, rgba(47, 125, 255, 0.24), transparent 31%),
    radial-gradient(circle at 84% 76%, rgba(73, 160, 255, 0.14), transparent 30%),
    radial-gradient(circle at 50% 120%, rgba(15, 57, 126, 0.42), transparent 44%),
    linear-gradient(135deg, #030712 0%, #06111f 50%, #040a13 100%);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background:
    linear-gradient(rgba(108, 147, 213, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 147, 213, 0.032) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 42%, black 0%, transparent 72%);
}

body::after {
  background:
    radial-gradient(circle at 26% 28%, rgba(65, 138, 255, 0.16), transparent 28%),
    radial-gradient(circle at 74% 18%, rgba(91, 162, 255, 0.1), transparent 25%),
    linear-gradient(180deg, rgba(255,255,255,0.018), transparent 22%);
  mix-blend-mode: screen;
  opacity: 0.9;
}

.page-shell,
.site-mark {
  position: relative;
  z-index: 1;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(420px, 0.94fr);
  gap: 34px;
  width: min(100%, 1460px);
  margin: 0 auto;
  padding: 116px 46px 46px;
}

.site-mark {
  position: fixed;
  top: 24px;
  left: 34px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.site-logo {
  display: block;
  width: 222px;
  height: auto;
  max-height: 96px;
  border-radius: 0;
  object-fit: contain;
  filter:
    drop-shadow(0 18px 28px rgba(0, 0, 0, 0.28))
    drop-shadow(0 0 22px rgba(47, 125, 255, 0.12));
}

.site-name {
  display: none;
}

.brand-panel,
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-panel {
  padding: 0 16px 0 0;
}

.auth-panel {
  padding: 0 0 0 16px;
}

.brand-wrap,
.card {
  width: min(100%, 540px);
}

.brand-wrap {
  position: relative;
  padding: 42px;
  border: 1px solid rgba(129, 165, 230, 0.12);
  border-radius: 34px;
  background:
    linear-gradient(150deg, rgba(14, 31, 58, 0.58), rgba(4, 10, 19, 0.36)),
    radial-gradient(circle at 16% 12%, rgba(47, 125, 255, 0.22), transparent 38%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.075),
    0 26px 90px rgba(0, 0, 0, 0.34);
  overflow: hidden;
}

.brand-wrap::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(110, 171, 255, 0.26), transparent 28%, transparent 68%, rgba(47, 125, 255, 0.18));
  opacity: 0.58;
  pointer-events: none;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  padding: 1px;
  mask-composite: exclude;
  -webkit-mask-composite: xor;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(29, 63, 115, 0.54);
  border: 1px solid rgba(139, 176, 239, 0.16);
  color: #d9e8ff;
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #78adff;
  box-shadow: 0 0 20px rgba(78, 136, 255, 0.9);
}

.brand-wrap h1 {
  margin: 22px 0 14px;
  font-size: clamp(2.5rem, 4.8vw, 4.45rem);
  line-height: 0.96;
  letter-spacing: -0.075em;
  max-width: 10ch;
}

.brand-wrap p {
  margin: 0;
  max-width: 52ch;
  color: #aebbd3;
  font-size: 1.03rem;
  line-height: 1.7;
}

.value-list {
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.value-list li {
  position: relative;
  min-height: 44px;
  padding: 12px 14px 12px 44px;
  border: 1px solid rgba(145, 170, 214, 0.1);
  border-radius: 16px;
  background: rgba(3, 10, 19, 0.34);
  color: #dce7fb;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

.value-list li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  box-shadow: 0 0 18px rgba(47, 125, 255, 0.55);
}

.card {
  position: relative;
  padding: 34px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(14, 26, 46, 0.94), rgba(4, 10, 19, 0.91)),
    radial-gradient(circle at 14% 0%, rgba(64, 135, 255, 0.16), transparent 38%);
  backdrop-filter: blur(22px);
  border: 1px solid var(--panel-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.085),
    inset 0 -1px 0 rgba(0, 0, 0, 0.38),
    var(--shadow);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 16% 0%, rgba(92, 164, 255, 0.18), transparent 32%),
    linear-gradient(135deg, rgba(255,255,255,0.07), transparent 28%);
  opacity: 0.72;
  pointer-events: none;
}

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

.card-header h2 {
  margin: 0 0 8px;
  font-size: 2rem;
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.card-header p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 17px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.86rem;
  color: #d7e5fb;
  font-weight: 800;
  letter-spacing: 0.015em;
}

.field input {
  width: 100%;
  border: 1px solid rgba(146, 179, 238, 0.14);
  background:
    linear-gradient(180deg, rgba(11, 22, 39, 0.92), rgba(5, 12, 23, 0.78));
  color: var(--text);
  border-radius: 15px;
  padding: 15px 16px;
  font: inherit;
  font-weight: 650;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.field input::placeholder {
  color: #74849c;
  font-weight: 600;
}

.field input:focus {
  border-color: rgba(76, 139, 255, 0.96);
  box-shadow:
    0 0 0 4px rgba(47, 125, 255, 0.18),
    0 0 34px rgba(47, 125, 255, 0.18),
    inset 0 1px 0 rgba(255,255,255,0.075);
  background: rgba(11, 23, 43, 0.96);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 86px;
}

.ghost-button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid rgba(146, 179, 238, 0.12);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  color: #d8e6ff;
  font: inherit;
  font-size: 0.83rem;
  font-weight: 800;
  cursor: pointer;
  padding: 8px 10px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.ghost-button:hover {
  background: rgba(47, 125, 255, 0.14);
  border-color: rgba(95, 157, 255, 0.28);
  color: #ffffff;
}

.form-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -2px;
}

.primary-button {
  position: relative;
  border: 1px solid rgba(166, 205, 255, 0.35);
  border-radius: 16px;
  padding: 15px 18px;
  font: inherit;
  font-weight: 900;
  letter-spacing: -0.01em;
  background:
    linear-gradient(135deg, #78adff 0%, #2f7dff 40%, #1745df 100%);
  color: #fff;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  box-shadow:
    0 18px 34px rgba(47, 125, 255, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -1px 0 rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.primary-button::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto 1px;
  height: 42%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.32), transparent);
  opacity: 0.84;
  pointer-events: none;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow:
    0 22px 42px rgba(47, 125, 255, 0.43),
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -1px 0 rgba(0, 0, 0, 0.28);
}

.primary-button:disabled {
  opacity: 0.66;
  cursor: not-allowed;
  transform: none;
}

.text-link {
  color: #d8e6ff;
  text-decoration: none;
  font-weight: 850;
  transition: color 0.18s ease;
}

.text-link:hover {
  color: #ffffff;
}

.status {
  margin-top: 16px;
  min-height: 24px;
  font-size: 0.93rem;
  line-height: 1.5;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
}

.status.success {
  color: var(--success);
}

.auth-footer {
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid rgba(145, 170, 214, 0.105);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  color: var(--muted);
}

@media (max-width: 1050px) {
  .page-shell {
    grid-template-columns: 1fr;
    width: min(100%, 760px);
    padding-top: 108px;
  }

  .brand-panel {
    padding: 0;
  }

  .auth-panel {
    padding: 0 0 40px;
  }

  .brand-wrap {
    width: 100%;
    padding: 30px;
  }

  .brand-wrap h1 {
    max-width: none;
    font-size: clamp(2.2rem, 8vw, 3.35rem);
  }
}

@media (max-width: 640px) {
  html,
  body {
    min-height: 100svh;
  }

  body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(22px, 4.8svh, 34px);
    padding: max(22px, env(safe-area-inset-top)) 0 max(22px, env(safe-area-inset-bottom));
    background:
      radial-gradient(circle at 50% -10%, rgba(47, 125, 255, 0.34), transparent 34%),
      radial-gradient(circle at 92% 66%, rgba(62, 139, 255, 0.12), transparent 34%),
      radial-gradient(circle at 50% 102%, rgba(26, 63, 140, 0.2), transparent 42%),
      linear-gradient(180deg, #030712 0%, #05101d 100%);
  }

  body::before {
    background-size: 32px 32px;
    opacity: 0.42;
    mask-image: radial-gradient(circle at 50% 42%, black 0%, transparent 70%);
  }

  body::after {
    background:
      radial-gradient(circle at 50% 4%, rgba(65, 138, 255, 0.18), transparent 34%),
      radial-gradient(circle at 50% 100%, rgba(26, 63, 140, 0.16), transparent 40%),
      linear-gradient(180deg, rgba(255,255,255,0.026), transparent 24%);
  }

  .site-mark {
    position: relative;
    top: auto;
    left: auto;
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 0 18px;
    margin: 0 0 clamp(4px, 1.4svh, 14px);
  }

  .site-logo {
    width: min(214px, 70vw);
    max-height: 92px;
    filter:
      drop-shadow(0 18px 30px rgba(0, 0, 0, 0.36))
      drop-shadow(0 0 24px rgba(47, 125, 255, 0.16));
  }

  .page-shell {
    display: block;
    min-height: auto;
    width: min(100%, 440px);
    padding: 0 18px;
  }

  .brand-panel {
    display: none;
  }

  .auth-panel {
    display: block;
    padding: 0;
  }

  .card {
    width: 100%;
    padding: 28px 18px 18px;
    border-radius: 26px;
    background:
      radial-gradient(circle at 50% 0%, rgba(74, 145, 255, 0.17), transparent 38%),
      linear-gradient(180deg, rgba(13, 25, 45, 0.96), rgba(4, 10, 19, 0.94));
    border-color: rgba(139, 176, 239, 0.18);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.09),
      inset 0 -1px 0 rgba(0, 0, 0, 0.36),
      0 22px 62px rgba(0, 0, 0, 0.48),
      0 0 0 1px rgba(47, 125, 255, 0.035),
      0 0 48px rgba(47, 125, 255, 0.09);
  }

  .card::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 25px;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.035);
  }

  .card-header {
    text-align: center;
  }

  .card-header h2 {
    margin-top: 2px;
    font-size: clamp(1.82rem, 9vw, 2.28rem);
    line-height: 0.98;
    letter-spacing: -0.06em;
    background: linear-gradient(180deg, #ffffff 0%, #e1ebff 76%, #a6b7d0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  .card-header p {
    max-width: 28ch;
    margin: 0 auto 18px;
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .auth-form {
    gap: 14px;
  }

  .field {
    gap: 7px;
  }

  .field span {
    font-size: 0.82rem;
  }

  .field input {
    min-height: 50px;
    padding: 13px 14px;
    border-radius: 14px;
    font-size: 0.96rem;
  }

  .password-wrap input {
    padding-right: 76px;
  }

  .ghost-button {
    right: 7px;
    padding: 7px 9px;
    font-size: 0.78rem;
  }

  .form-row {
    justify-content: center;
    margin-top: -1px;
  }

  .primary-button {
    min-height: 52px;
    border-radius: 15px;
    padding: 14px 16px;
    box-shadow:
      0 18px 38px rgba(47, 125, 255, 0.4),
      0 0 30px rgba(47, 125, 255, 0.16),
      inset 0 1px 0 rgba(255, 255, 255, 0.34),
      inset 0 -1px 0 rgba(0, 0, 0, 0.28);
  }

  .status {
    margin-top: 13px;
    min-height: 20px;
    text-align: center;
    font-size: 0.86rem;
  }

  .auth-footer {
    margin-top: 14px;
    padding-top: 14px;
    justify-content: center;
    font-size: 0.9rem;
  }
}

@media (max-width: 380px) {
  body {
    gap: 20px;
  }

  .page-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .card {
    padding: 22px 15px 16px;
  }

  .site-logo {
    width: min(198px, 72vw);
  }
}

@media (max-height: 670px) and (max-width: 640px) {
  body {
    justify-content: flex-start;
    gap: 18px;
    padding-top: max(20px, env(safe-area-inset-top));
  }

  .site-logo {
    width: min(188px, 66vw);
  }

  .card {
    padding-top: 24px;
  }

  .card-header h2 {
    font-size: 1.95rem;
  }

  .card-header p {
    margin-bottom: 15px;
  }
}

/* v55: explicit mobile logo-to-card breathing room. Desktop untouched. */
@media (max-width: 640px) {
  body {
    justify-content: center !important;
    gap: 0 !important;
    padding-top: max(34px, env(safe-area-inset-top)) !important;
    padding-bottom: max(26px, env(safe-area-inset-bottom)) !important;
  }

  .site-mark {
    margin: 0 0 clamp(46px, 8svh, 72px) !important;
    padding: 0 18px !important;
    flex: 0 0 auto !important;
  }

  .page-shell {
    margin: 0 auto !important;
    flex: 0 0 auto !important;
  }

  .card {
    margin-top: 0 !important;
  }
}

@media (max-width: 640px) and (max-height: 720px) {
  .site-mark {
    margin-bottom: 38px !important;
  }
}

@media (max-width: 640px) and (max-height: 630px) {
  body {
    justify-content: flex-start !important;
  }

  .site-mark {
    margin-bottom: 30px !important;
  }
}
