:root {
  color-scheme: dark;
  --canvas: #171717;
  --panel: #222222;
  --field: #303030;
  --ink: #f5f5f5;
  --muted: #b1b1b1;
  --line: #747474;
  --error: #ffb4ab;
  --focus: #aecbfa;
  font-family: "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:disabled, fieldset:disabled button { cursor: not-allowed; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 5px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 2;
  left: 20px;
  top: 16px;
  max-width: calc(100% - 40px);
  padding: 12px 18px;
  border-radius: 6px;
  color: #171717;
  background: #fff;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.page-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 48px 24px;
}

.access-panel {
  width: 100%;
  max-width: 600px;
  min-width: 0;
  padding: 60px 72px 30px;
  border-radius: 30px;
  background: var(--panel);
}

.brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 1.6875rem;
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: 1.3;
}
.brand > span { min-width: 0; overflow-wrap: anywhere; }
.brand-mark { flex: 0 0 1.625rem; width: 1.625rem; height: 1.625rem; }
.login-card { margin-block: 68px 76px; }
h1 { margin: 0; font-size: 2.375rem; font-weight: 600; letter-spacing: -.025em; line-height: 1.2; }
.intro { margin: 9px 0 0; color: #dedede; font-size: 1rem; line-height: 1.6; }
.preview-note { margin: 20px 0 28px; color: var(--muted); }
.preview-note p { margin: 0; font-size: .75rem; line-height: 1.7; }
.preview-note strong { font-weight: 500; }
.noscript-note { margin-block: 0 20px; font-size: .8125rem; line-height: 1.6; color: var(--error); }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.field { margin-bottom: 22px; }
.password-field { margin-bottom: 6px; }
.input-wrap { position: relative; border-radius: 8px; background: var(--field); }

input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 3.625rem;
  padding: 1.5rem 1.0625rem .5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color 120ms ease;
}
input:hover { border-color: #999; }
input:focus { outline: 2px solid var(--focus); outline-offset: 3px; border-color: var(--focus); }
input[aria-invalid="true"] { border-color: var(--error); }
input[aria-invalid="true"]:focus { outline-color: var(--error); }
fieldset:disabled input { color: var(--muted); }

/* Visible labels resemble the reference's placeholders while empty, but remain
   above entered text so the field's purpose is never lost. No JS is required. */
.input-wrap label {
  position: absolute;
  top: 1.125rem;
  left: 1.125rem;
  max-width: calc(100% - 2.25rem);
  color: #e4e4e4;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.3;
  pointer-events: none;
}
.input-wrap input:focus + label,
.input-wrap input:not(:placeholder-shown) + label {
  top: .375rem;
  font-size: .6875rem;
  color: #c5c5c5;
}
.password-input input { padding-right: 3.625rem; }
.password-input label { max-width: calc(100% - 4.75rem); }
.password-toggle {
  position: absolute;
  top: .4375rem;
  right: .375rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: .625rem;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
}
.password-toggle:hover { background: #444; }
.password-toggle:focus-visible { outline-offset: 0; }
.password-toggle svg { width: 1.4375rem; height: 1.4375rem; }
.password-toggle .eye-open { display: none; }
.password-toggle[data-visible="true"] .eye-open { display: block; }
.password-toggle[data-visible="true"] .eye-closed { display: none; }

.text-button {
  display: block;
  min-height: 2.75rem;
  max-width: 100%;
  margin: 0 0 25px;
  padding: 8px 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  font-size: .875rem;
  line-height: 1.5;
  text-align: left;
  text-underline-offset: 4px;
}
.text-button:hover { text-decoration: underline; }
.field-error { margin: 8px 0 0; color: var(--error); font-size: .75rem; line-height: 1.6; }
.recovery-note, .form-feedback {
  margin: 0 0 22px;
  padding: 14px 16px;
  border: 1px solid #6e6e6e;
  border-radius: 8px;
  color: #e0e0e0;
  background: #2c2c2c;
  font-size: .8125rem;
  line-height: 1.7;
}
.recovery-note strong { font-weight: 600; }
.recovery-note p { margin: 6px 0 0; }
.form-feedback { margin: 18px 0 0; }

.sign-in-button {
  display: block;
  width: 100%;
  min-height: 3.375rem;
  padding: 13px 18px;
  border: 1px solid #fff;
  border-radius: 8px;
  background: #fff;
  color: #171717;
  font-size: 1rem;
  font-weight: 550;
  line-height: 1.5;
  transition: background-color 120ms ease;
}
.sign-in-button:hover { background: #e5e5e5; }
.sign-in-button:active { background: #d4d4d4; }
fieldset:disabled .sign-in-button { color: #555; background: #ccc; border-color: #ccc; }
.access-note { margin-top: 27px; }
.access-note p { margin: 0; color: var(--muted); font-size: .8125rem; line-height: 1.85; }
.access-note span { color: #d4d4d4; }
.panel-footer { margin: 0; color: #aaa; font-size: .75rem; line-height: 1.8; text-align: center; }
.panel-footer span { padding-inline: 7px; }

@media (max-width: 600px) {
  .page-shell { padding: 24px 16px; }
  .access-panel { padding: 40px 30px 24px; border-radius: 24px; }
  .brand { font-size: 1.5625rem; }
  .login-card { margin-block: 48px 54px; }
}

@media (max-width: 380px) {
  .page-shell { padding: 16px 12px; }
  .access-panel { padding: 32px 20px 22px; border-radius: 20px; }
  .brand { gap: 8px; font-size: 1.375rem; }
  .brand-mark { flex-basis: 1.375rem; width: 1.375rem; height: 1.375rem; }
  .login-card { margin-block: 38px 42px; }
  h1 { font-size: 2.125rem; }
  .intro { font-size: .9375rem; }
  .panel-footer { font-size: .6875rem; }
  .panel-footer span { padding-inline: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  .access-panel { border: 1px solid CanvasText; }
  input, .sign-in-button { border: 1px solid ButtonText; }
  input:focus { outline-color: Highlight; }
}
