:root {
  color-scheme: light;
  --auth-blue: #295cd1;
  --auth-blue-dark: #1e3a80;
  --auth-ink: #17263d;
  --auth-muted: #667790;
  --auth-line: #e0e8f0;
  --auth-light: #f6f8fb;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--auth-ink);
  background: var(--auth-light);
  font-family: "DM Sans", sans-serif;
}

button,
input,
select { font: inherit; }

.auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(320px, .9fr) 1.1fr;
}

.auth-shell.login-page,
.auth-shell.register-page { grid-template-columns: 1fr; }

.auth-aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px clamp(32px, 5vw, 76px);
  color: #fff;
  background: var(--auth-blue-dark);
}

.brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
}

.brand:hover { color: inherit; }

.brand-logo {
  width: 44px;
  height: 44px;
  padding: 2px;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.aside-copy {
  width: 100%;
  max-width: 460px;
  margin: 56px 0;
}

.aside-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 3.5vw, 3.25rem);
  line-height: 1.17;
}

.aside-copy > p {
  margin: 0;
  color: #dce5fb;
  line-height: 1.7;
}

.feature-list {
  display: grid;
  gap: 14px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f1f4fc;
}

.feature-number {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 8px;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
}

.aside-foot {
  color: #cbd6f0;
  font-size: .85rem;
}

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card {
  width: min(100%, 460px);
  padding: 36px;
  border: 1px solid var(--auth-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 48px rgba(23, 38, 61, .07);
}

.mobile-brand { display: none; }

.login-page .auth-main,
.register-page .auth-main { min-height: 100vh; }

.login-page .auth-card,
.register-page .auth-card {
  width: min(100%, 440px);
  border-top: 4px solid var(--auth-blue);
}

.login-page .mobile-brand,
.register-page .mobile-brand {
  display: flex;
  justify-content: center;
  margin: 0 auto 28px;
  color: var(--auth-ink);
}

.login-page .form-heading,
.register-page .form-heading { text-align: center; }
.form-heading { margin-bottom: 24px; }

.form-heading h2 {
  margin: 0 0 8px;
  font-size: 1.75rem;
  line-height: 1.25;
}

.form-heading p {
  margin: 0;
  color: var(--auth-muted);
  line-height: 1.6;
}

.form-stack { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }

.field label {
  font-size: .92rem;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #cfd8e5;
  border-radius: 8px;
  outline: none;
  color: var(--auth-ink);
  background: #fff;
}

.field input::placeholder { color: #98a4b5; }

.field input:focus,
.field select:focus {
  border-color: var(--auth-blue);
  box-shadow: 0 0 0 3px rgba(41, 92, 209, .12);
}

.input-wrap { position: relative; }
.input-wrap input { padding-right: 52px; }

.show-password {
  display: grid;
  width: 36px;
  height: 36px;
  position: absolute;
  top: 50%;
  right: 6px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: var(--auth-blue);
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}

.show-password:focus-visible {
  outline: 2px solid var(--auth-blue);
  outline-offset: 1px;
}

.show-password i {
  font-size: 18px;
  line-height: 1;
}

.show-password[data-state="hidden"] { opacity: .55; }

.password-strength {
  height: 4px;
  margin-top: 3px;
  overflow: hidden;
  border-radius: 4px;
  background: #e9edf3;
}

.password-strength span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #d25a58;
  transition: width .2s ease, background-color .2s ease;
}

.password-strength[data-strength="weak"] span {
  width: 33%;
  background: #d25a58;
}

.password-strength[data-strength="medium"] span {
  width: 66%;
  background: #e7a43a;
}

.password-strength[data-strength="strong"] span {
  width: 100%;
  background: #279477;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.check-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--auth-muted);
  font-size: .88rem;
  line-height: 1.5;
}

.check-label input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 2px 0 0;
  accent-color: var(--auth-blue);
}

.agreement { margin-top: 2px; }

.small-link {
  padding: 0;
  border: 0;
  color: var(--auth-blue);
  background: transparent;
  cursor: pointer;
  font-size: .88rem;
  text-decoration: none;
}

.small-link:hover,
.switch-auth a:hover { color: var(--auth-blue-dark); }

.primary-btn {
  min-height: 48px;
  padding: 11px 16px;
  border: 1px solid var(--auth-blue);
  border-radius: 8px;
  color: #fff;
  background: var(--auth-blue);
  cursor: pointer;
  font-weight: 700;
}

.primary-btn:hover {
  border-color: var(--auth-blue-dark);
  background: var(--auth-blue-dark);
}

.switch-auth {
  margin: 22px 0 12px;
  color: var(--auth-muted);
  text-align: center;
}

.switch-auth a {
  color: var(--auth-blue);
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: minmax(280px, .8fr) 1.2fr; }
  .auth-aside { padding: 32px 28px; }
  .auth-card { padding: 30px; }
}

@media (max-width: 700px) {
  .auth-shell.register-page { grid-template-columns: 1fr; }
  .auth-main { padding: 24px 16px; }
  .auth-card { width: min(100%, 500px); padding: 24px; }
  .login-page .auth-card,
  .register-page .auth-card { width: min(100%, 440px); }
}

@media (max-width: 380px) {
  .auth-main { padding: 18px 12px; }
  .auth-card { padding: 20px; }
  .form-row { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { transition-duration: .01ms !important; }
}
