:root {
  color-scheme: light;
  --navy: #0a455f;
  --blue: #176c8c;
  --teal: #4caeb0;
  --ink: #173345;
  --muted: #5f7380;
  --line: #c9dce3;
  --paper: #ffffff;
  --error: #8d2e24;
  --success: #236a43;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 12%, rgba(76, 174, 176, 0.19), transparent 28rem),
    linear-gradient(145deg, #f8fbfc, #eaf4f7);
  font-family: "Segoe UI", Arial, sans-serif;
}

.login-shell {
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.login-card {
  width: min(840px, 100%);
  padding: clamp(26px, 6vw, 48px);
  border: 1px solid rgba(23, 108, 140, 0.22);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 22px 64px rgba(10, 69, 95, 0.14);
}

.login-logo {
  display: block;
  width: min(310px, 82%);
  height: auto;
  margin: 0 auto 22px;
}

h1,
h2 {
  margin: 0;
  color: var(--navy);
}

h1 {
  text-align: center;
  font-size: clamp(1.65rem, 4vw, 2.25rem);
}

.login-intro {
  margin: 12px 0 28px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.login-first-access {
  color: #a12821;
  font-size: 0.96rem;
  font-weight: 650;
}

.login-first-access span {
  display: block;
}

form {
  width: min(520px, 100%);
  margin-inline: auto;
}

label {
  display: block;
  margin: 16px 0 7px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #a9c3cd;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

input:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(23, 108, 140, 0.28);
  outline-offset: 2px;
}

.password-control {
  position: relative;
  display: block;
}

.password-control input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 40px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.password-toggle:hover {
  background: #eaf4f7;
}

.password-toggle:active {
  transform: translateY(-50%);
}

.password-eye-icon {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

button {
  min-height: 44px;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
}

.primary {
  border: 1px solid var(--blue);
  color: #fff;
  background: var(--blue);
  cursor: pointer;
}

.primary:hover {
  background: #145d79;
}

.primary:disabled {
  cursor: wait;
  opacity: 0.62;
}

#loginSubmit {
  width: 100%;
}

.secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #f4f8f9;
  cursor: pointer;
}

.link-button {
  display: block;
  margin: 12px auto 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  cursor: pointer;
}

.status {
  min-height: 1.5em;
  margin: 15px 0;
  color: var(--muted);
  line-height: 1.45;
}

.status.is-error {
  color: var(--error);
}

.status.is-success {
  color: var(--success);
}

dialog {
  width: min(520px, calc(100% - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 24px 80px rgba(10, 69, 95, 0.24);
}

dialog::backdrop {
  background: rgba(10, 38, 52, 0.5);
}

dialog form {
  padding: 28px;
}

dialog p {
  line-height: 1.5;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.dialog-actions button {
  padding: 8px 16px;
}

footer {
  padding: 14px 18px 18px;
  color: var(--muted);
  text-align: center;
  font-size: 0.86rem;
}

.product-footer-line {
  display: block;
  line-height: 1.45;
}

.product-footer-title {
  color: var(--ink);
}

.release-version {
  color: var(--muted);
  font-size: 0.9em;
}

@media (min-width: 820px) {
  .login-first-access span {
    white-space: nowrap;
  }
}

@media (max-width: 520px) {
  .login-shell {
    padding: 18px 12px;
  }

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

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .dialog-actions button {
    width: 100%;
  }
}

