:root {
  color-scheme: light;
  --page: #f3f6f8;
  --panel: #ffffff;
  --ink: #15202b;
  --muted: #627282;
  --line: #dce4ea;
  --focus: #00679e;
  --button: #0072b1;
  --button-hover: #005f93;
  --danger: #c5221f;
  --danger-bg: #fdeceb;
  --shadow: 0 24px 70px rgba(31, 45, 61, 0.16);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 16% 16%, rgba(19, 150, 190, 0.16), transparent 32rem),
    linear-gradient(135deg, #eef4f6 0%, #f7f9fb 44%, #eaf1f0 100%);
  color: var(--ink);
}

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

.auth-panel {
  width: min(100%, 420px);
  background: var(--panel);
  border: 1px solid rgba(220, 228, 234, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.brand-mark {
  position: relative;
  width: 58px;
  height: 38px;
  flex: 0 0 auto;
}

.brand-mark span {
  position: absolute;
  display: block;
  border: 4px solid var(--button);
  border-radius: 999px;
  background: #fff;
}

.brand-mark span:nth-child(1) {
  width: 30px;
  height: 30px;
  left: 0;
  top: 6px;
}

.brand-mark span:nth-child(2) {
  width: 40px;
  height: 40px;
  left: 14px;
  top: 0;
}

.brand-mark span:nth-child(3) {
  width: 30px;
  height: 30px;
  right: 0;
  top: 6px;
}

.brand-name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.brand-tagline {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.heading {
  margin-bottom: 22px;
}

.heading h1 {
  margin: 0;
  font-size: 1.85rem;
  line-height: 1.16;
  letter-spacing: 0;
}

.heading p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

label {
  font-size: 0.94rem;
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(0, 103, 158, 0.16);
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
}

.password-row input {
  border-radius: 6px 0 0 6px;
}

.icon-button {
  min-width: 46px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 6px 6px 0;
  background: #f8fafb;
  color: var(--muted);
  cursor: pointer;
}

.icon-button:hover {
  background: #edf3f5;
  color: var(--ink);
}

[data-eye] {
  display: inline-block;
  width: 18px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 999px / 70%;
  position: relative;
}

[data-eye]::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.35;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--button);
  flex: 0 0 auto;
}

.field-error {
  min-height: 1.1rem;
  margin: 0;
  color: var(--danger);
  font-size: 0.86rem;
  line-height: 1.3;
}

.server-error {
  border: 1px solid rgba(197, 34, 31, 0.26);
  border-radius: 6px;
  background: var(--danger-bg);
  color: var(--danger);
  padding: 11px 12px;
  font-size: 0.93rem;
  line-height: 1.38;
}

.primary-button {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  background: var(--button);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.primary-button:hover {
  background: var(--button-hover);
}

.primary-button:active {
  transform: translateY(1px);
}

.primary-button[disabled] {
  cursor: wait;
  opacity: 0.72;
}

.form-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  margin-top: 20px;
}

.form-links button {
  border: 0;
  background: transparent;
  color: var(--focus);
  padding: 4px 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.form-links button:hover {
  text-decoration: underline;
}

@media (max-width: 430px) {
  .shell {
    align-items: stretch;
    padding: 0;
  }

  .auth-panel {
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 24px 18px;
  }

  .brand-block {
    margin-bottom: 24px;
  }

  .heading h1 {
    font-size: 1.65rem;
  }
}
