:root {
  color-scheme: dark;
  --background: #0f1217;
  --surface: #191e26;
  --surface-2: #222934;
  --border: #313a48;
  --text: #f1f5fb;
  --muted: #9ba8ba;
  --accent: #5190f6;
  --accent-hover: #70a5f8;
  --success: #49b675;
  --danger: #e45d5d;
  --warning: #f0b54a;
  font-family: "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 15% 10%, rgba(81, 144, 246, 0.12), transparent 34rem),
    radial-gradient(circle at 85% 85%, rgba(73, 182, 117, 0.08), transparent 30rem),
    var(--background);
  color: var(--text);
}

button, input { font: inherit; }

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.card {
  width: min(720px, 100%);
  background: rgba(25, 30, 38, 0.96);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  padding: 34px;
}

.home-card { width: min(920px, 100%); }

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand img {
  border-radius: 16px;
  filter: drop-shadow(0 8px 22px rgba(0,0,0,.35));
}

.brand.compact { gap: 14px; }

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  line-height: 1.12;
}

h2 { font-size: 1.15rem; }

.lead {
  color: #c9d3e0;
  line-height: 1.65;
  margin: 28px 0;
}

.muted {
  color: var(--muted);
  margin: 26px 0 0;
  line-height: 1.55;
}

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

.info-grid article {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-2);
}

.info-grid article p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.step {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(81, 144, 246, 0.18);
  color: #91b8fb;
  font-weight: 700;
  margin-bottom: 14px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
}

.language-switch {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  flex: 0 0 auto;
}

.language {
  border: 0;
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.language.active {
  color: white;
  background: var(--accent);
}

.panel-state { padding-top: 28px; }
.panel-state.hidden, .hidden { display: none !important; }

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
  margin-bottom: 20px;
}

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

.account-chip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
}

.account-chip strong {
  color: var(--text);
  overflow-wrap: anywhere;
  text-align: right;
}

form { display: grid; gap: 10px; }
label { font-weight: 650; margin-top: 4px; }

input {
  width: 100%;
  border: 1px solid #445064;
  border-radius: 9px;
  padding: 13px 14px;
  color: var(--text);
  background: #11161d;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(81, 144, 246, 0.18);
}

.password-field { position: relative; }
.password-field input { padding-right: 76px; }
.text-button {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  border-radius: 7px;
  padding: 7px 9px;
  color: #9fc0fa;
  background: transparent;
  cursor: pointer;
}

.requirements {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 18px;
  margin: 10px 0 14px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: .9rem;
}

.requirements li::before {
  content: "○";
  display: inline-block;
  width: 20px;
  color: #738096;
}

.requirements li.pass { color: #a9dbbc; }
.requirements li.pass::before { content: "✓"; color: var(--success); }

.primary-button, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 0;
  border-radius: 9px;
  padding: 12px 18px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  color: white;
  background: var(--accent);
}
.primary-button:hover { background: var(--accent-hover); }
.primary-button:disabled { opacity: .6; cursor: wait; }
.secondary-button {
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.message {
  border-radius: 9px;
  padding: 12px 14px;
  margin: 2px 0 4px;
  line-height: 1.45;
}
.message.error { color: #ffd0d0; background: rgba(228, 93, 93, .12); border: 1px solid rgba(228, 93, 93, .35); }

.status-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin-bottom: 20px;
  font-size: 1.8rem;
  font-weight: 800;
}
.status-icon.success { color: #b9e7ca; background: rgba(73, 182, 117, .18); }
.status-icon.error { color: #ffd2d2; background: rgba(228, 93, 93, .18); }

.next-step {
  margin-top: 22px;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(81, 144, 246, .1);
  border: 1px solid rgba(81, 144, 246, .28);
  color: #bdd4fb;
}

@media (max-width: 720px) {
  .card { padding: 24px 20px; }
  .info-grid { grid-template-columns: 1fr; }
  .card-header { align-items: center; }
  .brand.compact img { width: 48px; height: 48px; }
  .requirements { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .card-header { align-items: flex-start; flex-direction: column; }
  .account-chip { flex-direction: column; }
  .account-chip strong { text-align: left; }
}

.status-icon.secure {
  color: #9fd3ff;
  background: rgba(74, 144, 226, .16);
  border: 1px solid rgba(74, 144, 226, .38);
}

.portal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.portal-actions .secondary-button {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface-2);
}

.portal-actions .secondary-button:hover {
  border-color: var(--accent);
  color: white;
}

.notice {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: #c9d3e0;
  line-height: 1.55;
}
