:root {
  --login-canvas: #f3f1ec;
  --login-surface: #fffefa;
  --login-soft: #f7f6f1;
  --login-ink: #122a3a;
  --login-copy: #455463;
  --login-muted: #71808d;
  --login-line: #d6dcd8;
  --login-line-strong: #bcc7c1;
  --login-teal: #147d64;
  --login-teal-dark: #0d6853;
  --login-danger: #a93f3a;
  --login-danger-soft: #fff3f1;
  --login-warning: #9a5c19;
  --login-warning-soft: #fff8ec;
  --login-focus: rgba(20, 125, 100, .16);
  --login-font: var(--rt-font-family, "Outfit", "Avenir Next", "Segoe UI", Arial, sans-serif);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--login-canvas);
}

body.rt-login-page {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--login-canvas);
  color: var(--login-ink);
  font-family: var(--login-font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.rt-login-page button,
.rt-login-page input {
  font: inherit;
}

.rt-login-page a {
  color: inherit;
}

.auth-page {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(420px, 1fr);
  background: var(--login-surface);
}

.auth-visual {
  position: relative;
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: #e8e2d8;
}

.auth-visual-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 50%;
}

.auth-visual-note {
  position: absolute;
  left: clamp(18px, 3vw, 42px);
  bottom: clamp(18px, 3vw, 38px);
  width: min(330px, calc(100% - 36px));
  padding: 14px 16px 13px;
  border-left: 4px solid #20a486;
  background: #122a3a;
  color: #fff;
  box-shadow: 0 10px 28px rgba(18, 42, 58, .22);
}

.auth-visual-note strong {
  display: block;
  margin: 0 0 2px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.015em;
}

.auth-visual-note span {
  display: block;
  color: #dce7e4;
  font-size: .75rem;
  line-height: 1.4;
}

.auth-form-panel {
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: clamp(32px, 5vw, 72px);
  border-left: 1px solid var(--login-line);
  background: var(--login-surface);
}

.auth-form-inner {
  width: min(100%, 430px);
  margin: auto;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 44px;
}

.auth-brand-logo {
  width: 64px;
  height: 64px;
  display: block;
  flex: 0 0 64px;
  object-fit: contain;
}

.auth-brand-name {
  margin: 0;
  color: var(--login-ink);
  font-size: clamp(1.45rem, 2.1vw, 2rem);
  font-weight: 750;
  line-height: 1.05;
  letter-spacing: -.035em;
  text-transform: uppercase;
}

.auth-brand-tagline {
  margin: 4px 0 0;
  color: var(--login-copy);
  font-size: .875rem;
  line-height: 1.35;
}

.auth-form-title {
  margin: 0;
  color: var(--login-ink);
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.03em;
}

.auth-form-subtitle {
  margin: 9px 0 28px;
  color: var(--login-copy);
  font-size: .875rem;
  line-height: 1.5;
}

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 20px;
  padding: 12px 13px;
  border: 1px solid;
  border-radius: 8px;
  font-size: .8125rem;
  line-height: 1.45;
}

.auth-alert svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 1px;
}

.auth-alert.is-error {
  border-color: #e6aaa5;
  background: var(--login-danger-soft);
  color: #81312d;
}

.auth-alert.is-warning {
  border-color: #e5c18d;
  background: var(--login-warning-soft);
  color: #7b4a16;
}

.auth-alert.is-success {
  border-color: #98cbbd;
  background: #eef8f4;
  color: #17604f;
}

.auth-alert-note {
  margin-top: 3px;
  color: inherit;
  font-size: .72rem;
  opacity: .82;
}

.auth-field {
  margin-bottom: 18px;
}

.auth-label {
  display: block;
  margin: 0 0 7px;
  color: var(--login-ink);
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.35;
}

.auth-input-wrap {
  min-width: 0;
  min-height: 50px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--login-line-strong);
  border-radius: 8px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-input-wrap:hover {
  border-color: #96a9a0;
}

.auth-input-wrap:focus-within {
  border-color: var(--login-teal);
  box-shadow: 0 0 0 3px var(--login-focus);
}

.auth-input-icon {
  width: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 46px;
  color: var(--login-muted);
}

.auth-input-icon svg {
  width: 18px;
  height: 18px;
}

.auth-input-wrap input {
  min-width: 0;
  width: 100%;
  flex: 1 1 auto;
  padding: 12px 10px 12px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--login-ink);
  font-size: 1rem;
  line-height: 1.4;
}

.auth-input-wrap input::placeholder {
  color: #9aa6ae;
  opacity: 1;
}

.auth-password-toggle {
  min-width: 68px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 0 10px;
  border: 0;
  border-left: 1px solid #e6e9e6;
  background: var(--login-soft);
  color: var(--login-copy);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 700;
  transition: background-color .15s ease, color .15s ease;
}

.auth-password-toggle svg {
  width: 17px;
  height: 17px;
}

.auth-password-toggle [hidden] {
  display: none !important;
}

.auth-password-toggle:hover {
  background: #eaf4f0;
  color: var(--login-teal-dark);
}

.auth-password-toggle:focus-visible,
.auth-forgot:focus-visible,
.auth-check:focus-within,
.auth-btn:focus-visible,
.auth-help a:focus-visible {
  outline: 3px solid var(--login-focus);
  outline-offset: 2px;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 22px;
}

.auth-check {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--login-copy);
  font-size: .78rem;
  line-height: 1.35;
  cursor: pointer;
  user-select: none;
}

.auth-check input[type="checkbox"] {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin: 0;
  accent-color: var(--login-teal);
  cursor: pointer;
}

.auth-forgot {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  color: var(--login-teal-dark);
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
}

.auth-forgot:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-btn {
  width: 100%;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid var(--login-teal);
  border-radius: 8px;
  background: var(--login-teal);
  color: #fff;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 750;
  line-height: 1.2;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.auth-btn svg {
  width: 18px;
  height: 18px;
}

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

.auth-btn:active {
  transform: translateY(1px);
}

.auth-btn:disabled {
  cursor: wait;
  opacity: .72;
}

.auth-security {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--login-line);
}

.auth-security-item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--login-copy);
  font-size: .72rem;
  line-height: 1.35;
}

.auth-security-item svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: var(--login-teal);
}

.captcha-wrap {
  margin: 0 0 18px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--login-line);
  border-radius: 8px;
  background: var(--login-soft);
}

.auth-debug {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid #d6dce0;
  border-radius: 8px;
  background: #f5f7f8;
  color: #53626e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .67rem;
  line-height: 1.55;
}

.auth-help {
  margin: 32px 0 0;
  color: var(--login-muted);
  font-size: .72rem;
  line-height: 1.4;
  text-align: center;
}

.auth-help a {
  color: var(--login-teal-dark);
  font-weight: 700;
  text-decoration: none;
}

.auth-help a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-recovery-note {
  margin: 15px 0 0;
  color: var(--login-muted);
  font-size: .72rem;
  line-height: 1.45;
  text-align: center;
}

@media (max-width: 1100px) {
  .auth-page {
    grid-template-columns: minmax(0, 1.1fr) minmax(390px, .9fr);
  }

  .auth-form-panel {
    padding: 36px;
  }

  .auth-brand {
    margin-bottom: 34px;
  }
}

@media (max-width: 820px) {
  .auth-page {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-visual {
    order: 1;
    min-height: clamp(215px, 42vw, 330px);
  }

  .auth-visual-image {
    object-position: 50% 48%;
  }

  .auth-visual-note {
    left: 18px;
    bottom: 18px;
    width: min(310px, calc(100% - 36px));
    padding: 11px 13px 10px;
  }

  .auth-form-panel {
    order: 2;
    min-height: auto;
    overflow: visible;
    padding: 34px 24px 44px;
    border-top: 1px solid var(--login-line);
    border-left: 0;
  }

  .auth-form-inner {
    width: min(100%, 500px);
  }
}

@media (max-width: 520px) {
  .auth-visual {
    min-height: 205px;
  }

  .auth-visual-note {
    left: 12px;
    bottom: 12px;
    width: min(270px, calc(100% - 24px));
    padding: 9px 11px 9px;
    border-left-width: 3px;
  }

  .auth-visual-note strong {
    font-size: .85rem;
  }

  .auth-visual-note span {
    font-size: .66rem;
  }

  .auth-form-panel {
    padding: 28px 18px 38px;
  }

  .auth-brand {
    gap: 11px;
    margin-bottom: 28px;
  }

  .auth-brand-logo {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }

  .auth-brand-name {
    font-size: 1.28rem;
  }

  .auth-brand-tagline {
    font-size: .75rem;
  }

  .auth-form-title {
    font-size: 1.45rem;
  }

  .auth-form-subtitle {
    margin-bottom: 23px;
    font-size: .82rem;
  }

  .auth-input-wrap input {
    font-size: 16px;
  }

  .auth-row {
    align-items: flex-start;
    gap: 8px;
  }

  .auth-check,
  .auth-forgot {
    font-size: .73rem;
  }

  .auth-security {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 370px) {
  .auth-form-panel {
    padding-inline: 14px;
  }

  .auth-password-toggle {
    min-width: 58px;
    padding-inline: 7px;
  }

  .auth-password-toggle span {
    font-size: .67rem;
  }

  .auth-row {
    flex-direction: column;
  }
}

@media (min-width: 821px) and (max-height: 720px) {
  .auth-form-panel {
    align-items: flex-start;
    padding-top: 28px;
    padding-bottom: 28px;
  }

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

  .auth-form-subtitle {
    margin-bottom: 20px;
  }

  .auth-field {
    margin-bottom: 14px;
  }

  .auth-row {
    margin-bottom: 16px;
  }

  .auth-security {
    margin-top: 16px;
    padding-top: 14px;
  }

  .auth-help {
    margin-top: 18px;
  }
}

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