:root {
  color-scheme: light dark;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--tg-theme-bg-color, #f4f2ec);
  color: var(--tg-theme-text-color, #18201d);
}

* { box-sizing: border-box; }

body { margin: 0; min-height: 100vh; }

main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: calc(24px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom));
}

.card {
  width: min(100%, 520px);
  padding: 26px;
  border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  border-radius: 20px;
  background: var(--tg-theme-secondary-bg-color, #ffffff);
  box-shadow: 0 18px 55px rgb(18 40 31 / 10%);
}

h1 { margin: 0 0 8px; font-size: clamp(1.65rem, 7vw, 2.3rem); line-height: 1.05; }
.intro, .privacy { color: var(--tg-theme-hint-color, #66706c); line-height: 1.5; }
.preview { padding: 10px 12px; border-radius: 10px; background: #fff3c4; color: #5e4800; font-weight: 650; }
.status { min-height: 1.5em; color: var(--tg-theme-hint-color, #66706c); overflow-wrap: anywhere; }
dl { display: grid; gap: 10px; margin: 22px 0; }
dl div { display: grid; gap: 3px; }
dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--tg-theme-hint-color, #66706c); }
dd { margin: 0; overflow-wrap: anywhere; }
label { display: grid; gap: 7px; margin: 15px 0; font-weight: 620; }
.credential-input {
  min-width: 0;
  flex: 1;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
  border-radius: 10px;
  background: var(--tg-theme-bg-color, #f8f8f6);
  color: inherit;
  font: inherit;
}
.credential-field { margin: 15px 0; }
.credential-field label { margin: 0 0 7px; }
.credential-entry { display: flex; gap: 8px; align-items: stretch; }
button.visibility-toggle {
  width: auto;
  min-width: 68px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: .9rem;
}
.visibility-toggle:focus-visible { outline: 2px solid var(--tg-theme-button-color, #237b62); outline-offset: 2px; }
.consent { grid-template-columns: 24px 1fr; align-items: start; font-weight: 500; line-height: 1.4; }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; }
button {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 12px;
  background: var(--tg-theme-button-color, #237b62);
  color: var(--tg-theme-button-text-color, white);
  font: inherit;
  font-weight: 750;
}
button:disabled { opacity: .55; }
.actions { display: grid; gap: 10px; }
#cancel {
  border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
  background: transparent;
  color: inherit;
}

[hidden] { display: none !important; }
.account-id { font-size: .8rem; color: var(--tg-theme-hint-color, #66706c); }
@media (max-width: 360px) { .card { padding: 18px; } main { padding-inline: 12px; } }
