:root {
  --purple: #6d248f;
  --heading: #4d1768;
  --ink: #2f2435;
  --muted: #6c6470;
  --line: #e4dce8;
  color: var(--ink);
  background: #f8f6fa;
  font-family: "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible {
  outline: 2px solid #9e75b4;
  outline-offset: 3px;
}
.login-shell {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(400px, .75fr);
  background: linear-gradient(135deg, #fbfafc, #f0ebf4);
}
.visual {
  position: relative;
  overflow: hidden;
  background: #f0ebf4;
}
.illustration {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: .78;
  filter: saturate(.58) brightness(1.08) contrast(.94);
}
.visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .42);
  pointer-events: none;
}
.access {
  display: grid;
  place-items: center;
  padding: clamp(22px, 2.65vw, 48px);
  background: linear-gradient(145deg, #fbf9fc, #f0ebf4);
}
.card {
  width: min(470px, 100%);
  padding: clamp(24px, 2.6vw, 36px);
  border: 1px solid rgba(109, 36, 143, .12);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 24px 58px rgba(55, 39, 63, .14);
}
.shield { display: block; object-fit: contain; margin: 0 auto 8px; }
.card h1, .card h2, .intro { text-align: center; }
.card h1 { margin: 2px 0 18px; color: var(--heading); font-size: 30px; }
.card h2 { margin: 0 0 5px; font-size: 19px; }
.intro { margin: 0 0 24px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.field + .field { margin-top: 13px; }
.field label, #dialog-fields label { color: #514556; font-size: 13px; font-weight: 700; }
.field label { display: block; margin-bottom: 6px; }
.field input, #dialog-fields input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #dcd3e1;
  border-radius: 12px;
  color: var(--ink);
  background: white;
  font-size: 15px;
}
.field input:focus, #dialog-fields input:focus {
  border-color: #9e75b4;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(142, 76, 174, .14);
}
.password-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
#eye {
  min-width: 74px;
  padding: 0 10px;
  border: 1px solid #dcd3e1;
  border-radius: 12px;
  background: white;
  color: var(--purple);
  font-size: 13px;
  font-weight: 700;
}
.recovery { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 12px 0 14px; }
.recovery button { padding: 2px 0; border: none; background: transparent; color: var(--purple); font-size: 12px; text-decoration: underline; }
.primary, .secondary {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 750;
}
.primary { border: 1px solid transparent; background: linear-gradient(90deg, #81409d, #6d248f); color: white; }
.primary:hover { filter: brightness(1.05); }
.primary:disabled { opacity: .72; cursor: wait; }
.secondary { margin-top: 9px; border: 1px solid #d9c3e3; background: #faf7fc; color: var(--purple); }
.secondary:hover { background: #f3ebf8; }
.login-status { margin: 0 0 12px; color: var(--heading); font-size: 13px; line-height: 1.4; }
.login-status.error, #dialog-status.error { color: #a52634; }
.back { display: block; margin-top: 16px; color: var(--purple); text-align: center; font-size: 12px; font-weight: 700; text-decoration: none; }
.back:hover { text-decoration: underline; }
.login-footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 26px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: #f7f4f8;
  color: #665c6a;
  font-size: 11px;
  text-align: center;
}
dialog {
  width: min(92vw, 460px);
  max-height: 90vh;
  padding: 24px;
  border: 1px solid #dbcbe5;
  border-radius: 18px;
  color: var(--ink);
  box-shadow: 0 14px 60px #1b082972;
}
dialog::backdrop { background: #160321aa; }
dialog h2 { margin: 0 0 6px; color: var(--heading); }
dialog p { line-height: 1.42; }
#dialog-fields { display: grid; gap: 12px; }
#dialog-fields label { display: grid; gap: 5px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.dialog-actions button {
  padding: .58em .85em;
  border: 1px solid #caafd8;
  border-radius: 8px;
  background: white;
  color: var(--heading);
  font-weight: 650;
}
#dialog-submit { background: var(--purple); border-color: var(--purple); color: white; }
@media (max-width: 820px) {
  .login-shell { grid-template-columns: minmax(0, 1fr); }
  .visual { display: none; }
  .access { padding: 20px 18px; }
}
@media (max-width: 420px) {
  .card { padding: 25px 19px; border-radius: 21px; }
  .card h1 { font-size: 27px; }
  .card h2 { font-size: 17px; }
}
