:root {
  --brand: #1d1c9f;
  --brand-soft: rgba(29, 28, 159, 0.08);
  --text: #14111f;
  --muted: #6b6477;
  --surface: rgba(255, 255, 255, 0.94);
  --border: rgba(20, 17, 31, 0.08);
  --success: #067647;
  --success-bg: #ecfdf3;
  --danger: #b42318;
  --danger-bg: #fff2f0;
  --info: #1849a9;
  --info-bg: #eff6ff;
  --shadow-card: 0 22px 60px rgba(17, 24, 39, 0.10);
  --radius-xl: 26px;
  --radius-lg: 18px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at 50% -10%, rgba(29, 28, 159, 0.10), transparent 34%),
    linear-gradient(180deg, #f8f7fb 0%, #f3f5f9 100%);
}

button, input { font: inherit; }
button { border: 0; cursor: pointer; }
input { outline: none; }

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

.card {
  width: min(100%, 410px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: 28px 26px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.card-centered {
  display: grid;
  justify-items: center;
  text-align: center;
}

.brand-block {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 0 auto 24px;
}

.brand-logo {
  display: block;
  width: min(226px, 76vw);
  max-height: 88px;
  object-fit: contain;
}

.icon-circle {
  width: 54px;
  height: 54px;
  margin: 0 auto 15px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 27px;
  font-weight: 950;
}

.icon-circle.success { background: var(--success-bg); color: var(--success); }
.icon-circle.error { background: var(--danger-bg); color: var(--danger); }
.icon-circle.lock { background: var(--brand-soft); color: var(--brand); font-size: 36px; }
.icon-circle.loading { background: var(--brand-soft); }

h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.62rem, 5.8vw, 2rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.lead {
  max-width: 330px;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.notice {
  display: grid;
  gap: 3px;
  width: 100%;
  max-width: 340px;
  margin-top: 18px;
  padding: 13px 15px;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  text-align: center;
  font-size: 14px;
  line-height: 1.45;
}

.notice strong { font-size: 14px; }
.notice span { color: inherit; opacity: 0.92; }
.notice.info { background: var(--info-bg); border-color: rgba(24, 73, 169, 0.10); color: var(--info); }
.notice.success { background: var(--success-bg); border-color: rgba(6, 118, 71, 0.12); color: var(--success); }
.notice.error { background: var(--danger-bg); border-color: rgba(180, 35, 24, 0.12); color: var(--danger); }
.notice.compact { margin-left: auto; margin-right: auto; }

.form {
  width: 100%;
  max-width: 340px;
  display: grid;
  gap: 13px;
  margin: 20px auto 0;
  text-align: left;
}

.field { display: grid; gap: 7px; }
.label {
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}

.input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border-radius: 17px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  font-size: 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input:focus {
  border-color: color-mix(in srgb, var(--brand) 38%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent);
}

.help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.btn {
  min-height: 52px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 17px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { cursor: wait; opacity: 0.65; transform: none; }

.btn-primary {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 14px 28px rgba(29, 28, 159, 0.20);
}

.store-return {
  margin-top: 20px;
  text-decoration: none;
}

.store-return:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
}

.footer-note {
  margin: 16px auto 0;
  max-width: 330px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.hidden { display: none !important; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner.dark {
  width: 22px;
  height: 22px;
  border-color: color-mix(in srgb, var(--brand) 18%, transparent);
  border-top-color: var(--brand);
}

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

@media (max-width: 520px) {
  .page {
    align-items: start;
    padding-top: 16px;
  }

  .card {
    padding: 22px 18px;
    border-radius: 24px;
  }

  .brand-block { margin-bottom: 22px; }
  .brand-logo { width: min(210px, 74vw); }
  h1 { font-size: clamp(1.56rem, 8vw, 1.92rem); }
  .lead { font-size: 14.5px; }
}

.card-home {
  padding-top: 32px;
  padding-bottom: 34px;
}

.brand-block-home {
  margin-bottom: 18px;
}

.brand-logo-home {
  width: min(230px, 74vw);
}

.card-home .lead {
  max-width: 300px;
  margin-top: 9px;
}
