/* Login page — split layout */
.page-login {
  background: #f0f2f5;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.login-panel {
  display: grid;
  grid-template-columns: 58fr 42fr;
  width: 100%;
  max-width: 900px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.login-panel__visual {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f3f7fb;
  overflow: hidden;
}

.login-panel__illustration {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.login-panel__illustration-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #bbbbbb;
  font-size: 14px;
  background: #e8eef5;
}

.login-panel__illustration-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.5;
}

.login-panel__slogan {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 16px;
  padding: 32px 36px;
  white-space: nowrap;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
}

.login-panel__slogan-title {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  color: #333333;
}

.login-panel__slogan-sub {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  color: #58a6f7;
}

.login-panel__form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 36px;
  background: #ffffff;
}

.login-panel__title {
  font-size: 20px;
  font-weight: 600;
  color: #333333;
  text-align: center;
  margin-bottom: 36px;
  position: relative;
  padding-bottom: 12px;
}

.login-panel__title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: #58a6f7;
  border-radius: 2px;
}

.login-form__error {
  display: none;
  margin-bottom: 16px;
  padding: 8px 12px;
  font-size: 13px;
  color: #e53935;
  background: #fff5f5;
  border-radius: 4px;
  line-height: 1.5;
}

.login-form__error.is-visible {
  display: block;
}

.login-form__group {
  margin-bottom: 20px;
}

.login-form__hint {
  display: none;
  margin-top: 6px;
  font-size: 12px;
  color: #e53935;
  line-height: 1.4;
}

.login-form__hint.is-visible {
  display: block;
}

.login-form__group--password {
  position: relative;
}

.login-form__input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  color: #333333;
  outline: none;
  transition: border-color 0.2s ease;
}

.login-form__group--password .login-form__input {
  padding-right: 44px;
}

.login-form__input::placeholder {
  color: #bbbbbb;
}

.login-form__input:focus {
  border-color: #58a6f7;
}

.login-form__input.is-invalid {
  border-color: #e53935;
}

.login-form__input.is-invalid:focus {
  border-color: #e53935;
}

.login-form__toggle-pwd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbbbbb;
  padding: 4px;
  transition: color 0.2s ease;
}

.login-form__toggle-pwd:hover {
  color: #58a6f7;
}

.login-form__pwd-icon--hide {
  display: none;
}

.login-form__toggle-pwd.is-visible .login-form__pwd-icon--show {
  display: none;
}

.login-form__toggle-pwd.is-visible .login-form__pwd-icon--hide {
  display: block;
}

.login-form__agreement {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 13px;
  color: #666666;
  line-height: 1.5;
  cursor: pointer;
}

.login-form__agreement input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 3px;
  width: 14px;
  height: 14px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #d0d0d0;
  border-radius: 2px;
  background: #ffffff;
  cursor: pointer;
  position: relative;
}

.login-form__agreement input[type="checkbox"]:checked {
  background: #58a6f7;
  border-color: #58a6f7;
}

.login-form__agreement input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 3px;
  height: 7px;
  border: solid #ffffff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.login-form__agreement-link {
  border: none;
  background: none;
  padding: 0;
  font-size: inherit;
  color: #58a6f7;
  cursor: pointer;
  line-height: inherit;
}

.login-form__agreement-link:hover {
  text-decoration: underline;
}

.login-form__submit {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
  background: #58a6f7;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.login-form__submit:hover {
  background: #3d96f5;
}

.captcha-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
  visibility: hidden;
}

.captcha-modal.is-open {
  pointer-events: auto;
  visibility: visible;
}

.captcha-modal__mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.captcha-modal.is-open .captcha-modal__mask {
  opacity: 1;
}

.captcha-modal__box {
  position: relative;
  width: 100%;
  max-width: 340px;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  padding: 0 0 16px;
  transform: translateY(12px);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.captcha-modal.is-open .captcha-modal__box {
  transform: translateY(0);
  opacity: 1;
}

.captcha-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.captcha-modal__title {
  font-size: 16px;
  font-weight: 600;
  color: #333333;
}

.captcha-modal__close {
  width: 28px;
  height: 28px;
  font-size: 22px;
  line-height: 1;
  color: #999999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.captcha-modal__close:hover {
  color: #333333;
}

.captcha-modal__box--simple {
  max-width: 360px;
  padding-bottom: 20px;
}

.captcha-modal__simple-body {
  padding: 24px 20px 8px;
  text-align: center;
}

.captcha-modal__desc {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.6;
  color: #666666;
}

.captcha-modal__confirm {
  display: block;
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 6px;
  background: #58a6f7;
  color: #ffffff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.captcha-modal__confirm:hover {
  background: #3d96f5;
}

.captcha-modal__confirm:active {
  transform: scale(0.98);
}

.captcha-modal.is-success .captcha-modal__confirm {
  background: #10b981;
}

.agreement-drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  visibility: hidden;
}

.agreement-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}

.agreement-drawer__mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.agreement-drawer.is-open .agreement-drawer__mask {
  opacity: 1;
}

.agreement-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(480px, 92vw);
  height: 100%;
  background: #ffffff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.agreement-drawer.is-open .agreement-drawer__panel {
  transform: translateX(0);
}

.agreement-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #eeeeee;
  flex-shrink: 0;
}

.agreement-drawer__title {
  font-size: 18px;
  font-weight: 600;
  color: #333333;
}

.agreement-drawer__close {
  width: 32px;
  height: 32px;
  font-size: 24px;
  line-height: 1;
  color: #999999;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.2s ease, background 0.2s ease;
}

.agreement-drawer__close:hover {
  color: #333333;
  background: #f5f5f5;
}

.agreement-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  font-size: 14px;
  color: #666666;
  line-height: 1.8;
}

.agreement-drawer__body h4 {
  margin: 20px 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: #333333;
}

.agreement-drawer__body h4:first-child {
  margin-top: 0;
}

.agreement-drawer__body p {
  margin-bottom: 8px;
}

.login-panel__footer {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
  color: #999999;
}

.login-panel__footer a {
  color: #58a6f7;
}

@media (max-width: 768px) {
  .login-panel {
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  .login-panel__slogan {
    gap: 12px;
    padding: 24px 28px;
    font-size: 16px;
  }

  .login-panel__form {
    padding: 32px 28px 40px;
  }
}

/* Register page — original card layout */
.auth-page {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-3xl) var(--container-padding);
  background: var(--color-bg-light);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--color-bg);
  border-radius: var(--radius-xl);
  padding: var(--spacing-3xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border-light);
}

.auth-card__title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--spacing-sm);
}

.auth-card__subtitle {
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  margin-bottom: var(--spacing-2xl);
}

.auth-form__group {
  margin-bottom: var(--spacing-lg);
}

.auth-form__label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin-bottom: var(--spacing-sm);
}

.auth-form__input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-fast);
}

.auth-form__input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.auth-form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
  font-size: var(--font-size-sm);
}

.auth-form__checkbox {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--color-text-light);
}

.auth-form__link {
  color: var(--color-primary);
}

.auth-form__submit {
  width: 100%;
  margin-bottom: var(--spacing-lg);
}

.auth-card__footer {
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}

.auth-card__footer a {
  color: var(--color-primary);
  font-weight: 500;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin: var(--spacing-lg) 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.auth-social {
  display: flex;
  gap: var(--spacing-md);
}

.auth-social__btn {
  flex: 1;
  padding: 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  text-align: center;
  transition: all var(--transition-fast);
}

.auth-social__btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
