:root {
  color-scheme: dark;
  --bg: #050810;
  --panel: rgba(11, 16, 32, 0.78);
  --text: #f0f4ff;
  --muted: #98a2b8;
  --line: rgba(255, 255, 255, 0.14);
  --hot: #ff6a61;
  --orange: #ff8b61;
  --pink: #ffc2df;
  --shadow: 0 16px 54px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 106, 97, 0.2), transparent 30rem),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.stars {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.8) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 106, 97, 0.32) 0 1px, transparent 1.5px);
  background-position: 24px 30px, 220px 80px;
  background-size: 180px 210px, 330px 280px;
  opacity: 0.6;
}

.auth-layout,
.account-layout {
  width: min(1120px, calc(100% - 34px));
  margin: 0 auto;
  padding: 32px 0;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: 30px;
  align-items: center;
  min-height: 100vh;
}

.brand-panel img {
  width: 96px;
  filter: drop-shadow(0 0 34px rgba(255, 106, 97, 0.52));
}

.brand-panel,
.auth-card {
  min-width: 0;
}

.eyebrow {
  margin: 18px 0 12px;
  color: var(--hot);
  font-weight: 900;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  overflow: hidden;
  margin-bottom: 14px;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: linear-gradient(90deg, var(--pink), var(--hot) 58%, var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

p {
  color: var(--muted);
  line-height: 1.72;
}

.quick-links,
.account-head nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.quick-links a,
.account-head a,
.account-head button,
.auth-card,
.info-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)), var(--panel);
  box-shadow: var(--shadow);
}

.quick-links a,
.account-head a,
.account-head button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 16px;
  color: #dce5ff;
  cursor: pointer;
}

.auth-card {
  width: 100%;
  padding: 24px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.mode-tabs.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mode-tabs button,
.primary,
#send-code {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  font-weight: 900;
}

.mode-tabs .active,
.primary {
  background: linear-gradient(135deg, var(--hot), var(--orange));
  color: white;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: #cdd5e8;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: rgba(5, 8, 16, 0.72);
}

option {
  background: #0b1020;
}

.password-field {
  display: grid;
  grid-template-columns: 1fr 52px;
  gap: 8px;
  align-items: center;
}

.password-field input {
  min-width: 0;
}

.icon-button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: #dce5ff;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  font-weight: 900;
}

.icon-button.active,
.icon-button:hover {
  border-color: rgba(255, 106, 97, 0.58);
  color: white;
  background: rgba(255, 106, 97, 0.16);
}

.code-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
  align-items: end;
}

.note {
  min-height: 24px;
  margin-bottom: 0;
}

.account-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.account-head h1 {
  margin-bottom: 0;
}

.account-head button {
  color: white;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.info-card {
  padding: 20px;
}

.info-card.wide {
  grid-column: 1 / -1;
}

.metric {
  color: var(--text);
  font-size: 25px;
  font-weight: 900;
}

@media (min-width: 821px) and (max-height: 820px) {
  .auth-layout,
  .account-layout {
    padding: 18px 0;
  }

  .brand-panel img {
    width: 78px;
  }

  h1 {
    font-size: clamp(22px, 6.2vw, 32px);
  }

  .auth-card,
  .info-card {
    padding: 18px;
  }

  .quick-links,
  .account-head nav {
    margin-top: 14px;
  }
}

@media (max-width: 820px) {
  .auth-layout,
  .account-grid {
    grid-template-columns: 1fr;
  }

  .account-head {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  body {
    background:
      radial-gradient(circle at 50% 0%, rgba(255, 106, 97, 0.16), transparent 22rem),
      var(--bg);
  }

  .auth-layout,
  .account-layout {
    width: min(100% - 24px, 560px);
    padding: 16px 0 24px;
  }

  .auth-layout {
    align-items: start;
    min-height: 100vh;
  }

  .auth-card {
    order: 1;
    width: 100%;
    padding: 17px;
  }

  .brand-panel {
    order: 2;
  }

  .brand-panel img {
    width: 64px;
  }

  .brand-panel h1 {
    font-size: 34px;
  }

  .brand-panel p:not(.eyebrow) {
    display: none;
  }

  .quick-links {
    margin-top: 12px;
  }

  .quick-links a,
  .account-head a,
  .account-head button {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 42px;
  }

  .account-head {
    gap: 12px;
  }

  .account-head nav {
    width: 100%;
    gap: 8px;
    margin-top: 8px;
  }

  .account-head h1 {
    font-size: 38px;
  }

  .info-card {
    padding: 16px;
  }

  .metric {
    font-size: 22px;
    overflow-wrap: anywhere;
  }

  .mode-tabs button,
  .primary,
  #send-code,
  .icon-button,
  input,
  select {
    min-height: 46px;
  }

  .mode-tabs.three {
    grid-template-columns: 1fr;
  }

  .code-row {
    grid-template-columns: 1fr;
  }
}
