@media (prefers-reduced-motion: no-preference) {
  :root {
    scroll-behavior: smooth;
  }
}

:root {
  --blue: #0096d6;
  --blue-strong: #0079b6;
  --slate: #2f2f2f;
  --text: #1d1d1d;
  --border: #d4d8df;
  --bg: #ffffff;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Montserrat", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

.auth-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 48px 20px 64px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.brand-mark {
  width: min(360px, 70vw);
}

.brand-mark svg {
  width: 100%;
  height: auto;
  display: block;
}

.brand-mark img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.brand-text {
  font-size: 17px;
  letter-spacing: 0.02em;
  font-weight: 700;
  line-height: 1.3;
  color: var(--slate);
}

.auth-card {
  width: min(520px, 90vw);
  background: #fdfdfd;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 32px 32px;
  box-shadow: var(--shadow);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-weight: 600;
  font-size: 15px;
}

.field input {
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 150, 214, 0.18);
}

.input-with-toggle {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-toggle input {
  width: 100%;
  padding-right: 44px;
}

.toggle-password {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: #6a6a6a;
  cursor: pointer;
  height: 32px;
  width: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.12s ease, color 0.12s ease;
}

.toggle-password:hover,
.toggle-password:focus-visible {
  background: rgba(0, 150, 214, 0.08);
  color: var(--blue);
}

.toggle-password:focus-visible {
  outline: 3px solid rgba(0, 150, 214, 0.3);
  outline-offset: 2px;
}

.form-meta {
  display: flex;
  justify-content: flex-end;
  font-size: 13px;
}

.cta {
  height: 48px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 24px rgba(0, 119, 182, 0.22);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.cta:hover {
  background: var(--blue-strong);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 119, 182, 0.28);
}

.cta:active {
  transform: translateY(0);
}

.cta:focus-visible {
  outline: 3px solid rgba(0, 150, 214, 0.3);
  outline-offset: 3px;
}

.cta .arrow {
  font-size: 18px;
}

.cta:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.form-hint {
  min-height: 18px;
  margin: 0;
  font-size: 13px;
  color: #d64545;
}

.helper-text {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.5;
  color: #303030;
}

.code-inputs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
  width: 100%;
}

.code-box {
  height: 50px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 22px;
  text-align: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  min-width: 0;
}

.code-box:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 150, 214, 0.18);
}

.code-box.filled {
  background: #e9f7ff;
  border-color: rgba(0, 150, 214, 0.65);
  box-shadow: 0 0 0 1px rgba(0, 150, 214, 0.35);
}

.code-inputs.complete {
  box-shadow: 0 8px 20px rgba(0, 150, 214, 0.08);
  border-radius: 12px;
  padding: 4px 0;
}

.strength-wrap {
  margin-top: 0px;
  padding: 0 4px;
}

.strength-meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-bottom: 6px;
}

.strength-meter span {
  height: 4px;
  background: #dfe4ec;
  transition: background 0.18s ease;
}

.strength-meter span:first-child {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.strength-meter span:last-child {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

.strength-meter.weak span:nth-child(-n + 1) {
  background: #d64545;
}

.strength-meter.fair span:nth-child(-n + 2) {
  background: #e7a33b;
}

.strength-meter.good span:nth-child(-n + 3) {
  background: #7cb342;
}

.strength-meter.strong span:nth-child(-n + 4) {
  background: #0096d6;
}

.strength-text {
  margin: 0;
  font-size: 13px;
  color: #4a4a4a;
}

.site-footer {
  border-top: 1px solid #e4e7ec;
  padding: 12px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  font-size: 13px;
  color: #4a4a4a;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--slate);
  font-weight: 700;
}

.footer-brand img {
  width: 100px;
  height: auto;
  display: block;
  object-fit: contain;
}

.footer-copy {
  text-align: center;
  font-weight: 700;
  color: var(--blue-strong);
}

.footer-meta {
  text-align: right;
  color: #7a7a7a;
}

@media (max-width: 768px) {
  .auth-shell {
    padding-top: 28px;
    gap: 28px;
  }

  .brand {
    flex-direction: column;
    text-align: center;
  }

  .auth-card {
    width: 100%;
  }

  .site-footer {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }

  .footer-meta {
    text-align: center;
  }
}
