:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --surface-strong: #eef4ff;
  --border: #dde6f2;
  --text: #162033;
  --text-soft: #59657d;
  --text-muted: #7f8aa2;
  --primary: #3563ff;
  --primary-soft: #eaf0ff;
  --danger: #d64545;
  --shadow-md: 0 18px 44px rgba(26, 38, 62, 0.08);
  --radius-lg: 28px;
  --radius-md: 16px;
  --heading: "Sora", "Plus Jakarta Sans", sans-serif;
  --body: "Plus Jakarta Sans", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--body);
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(53, 99, 255, 0.14), transparent 24%),
    radial-gradient(circle at left 18%, rgba(20, 184, 166, 0.08), transparent 20%),
    linear-gradient(180deg, #f7faff, #f3f6fc 46%, #eef3fb 100%);
}

.page.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-shell {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: minmax(360px, 460px) minmax(280px, 1fr);
  align-items: stretch;
  gap: 18px;
}

.auth-card {
  width: 100%;
  padding: 34px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-md);
}

.download-card {
  min-width: 0;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid #cbd9f2;
  background:
    linear-gradient(180deg, rgba(234, 240, 255, 0.78), rgba(255, 255, 255, 0.94)),
    var(--surface);
  box-shadow: var(--shadow-md);
}

.material-symbols-rounded {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  font-family: "Material Symbols Rounded";
  font-weight: 650;
  font-style: normal;
  font-size: 1.25rem;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "liga";
}

.download-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid #d7e1f3;
}

.download-icon .material-symbols-rounded {
  font-size: 1.7rem;
}

.download-kicker {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.download-card h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--heading);
  font-size: 1.45rem;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.download-copy {
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 0.94rem;
  line-height: 1.65;
}

.download-btn {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  color: #ffffff;
  background: #15173f;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 12px 22px rgba(21, 23, 63, 0.16);
  transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.download-btn:hover {
  background: #20245c;
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(21, 23, 63, 0.2);
}

.download-btn:focus-visible {
  outline: 3px solid rgba(53, 99, 255, 0.24);
  outline-offset: 3px;
}

.download-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  color: #42516b;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #dbe5f3;
  font-size: 0.82rem;
  line-height: 1.55;
}

.title {
  margin: 0;
  font-family: var(--heading);
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.05em;
}

.muted {
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 0.96rem;
  line-height: 1.65;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 22px;
}

.label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-soft);
  font-size: 0.86rem;
  font-weight: 700;
}

input {
  min-height: 52px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  outline: none;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

input::placeholder {
  color: #96a2b6;
}

input:focus {
  border-color: rgba(53, 99, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(53, 99, 255, 0.08);
}

button {
  min-height: 52px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: linear-gradient(135deg, #3563ff, #5e86ff);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 18px 30px rgba(53, 99, 255, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.msg {
  min-height: 20px;
  margin: 2px 0 0;
  color: var(--danger);
  font-size: 0.86rem;
}

.initialization-error {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(244, 247, 251, 0.82);
  backdrop-filter: blur(6px);
}

.error-content {
  width: min(460px, 100%);
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-md);
}

.error-content h3 {
  margin: 0;
  font-family: var(--heading);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.error-content p {
  margin-top: 12px;
  color: var(--text-soft);
  line-height: 1.65;
}

.retry-btn {
  width: 100%;
  margin-top: 18px;
}

@media (max-width: 640px) {
  .page.auth {
    padding: 18px;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 26px;
  }

  .download-card {
    padding: 24px;
  }
}
