/* ==========================================================================
   AUTH PAGES — LOGIN / REGISTER / FORGOT PASSWORD / SET PASSWORD
   ========================================================================== */

body.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--body-color);
  padding: 20px;
}

.auth-wrapper {
  width: 100%;
  max-width: 500px;
}

.auth-wrapper.auth-wrapper-wide {
  max-width: 900px;
}

.auth-card {
  width: 100%;
  background: var(--sidebar-color);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(64, 112, 244, 0.12);
}

.auth-brand {
  text-align: center;
  margin-bottom: 30px;
}

.auth-brand img {
  max-height: 50px;
  margin-bottom: 15px;
}

.auth-brand p {
  color: var(--text-color);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.6;
}

.auth-card h1 {
  color: var(--text-dark);
  font-size: 1.55rem;
  line-height: 1.3;
  margin: 0 0 18px 0;
  text-align: center;
}

.auth-card p {
  color: var(--text-color);
  font-size: 0.94rem;
  line-height: 1.65;
  margin: 0 0 18px 0;
}

.auth-footer {
  margin-top: 25px;
  text-align: center;
  display: grid;
  gap: 10px;
}

.auth-link {
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.auth-link strong,
.auth-link-highlight {
  color: var(--primary-color);
  font-weight: 700;
}

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

.auth-input-icon {
  position: relative;
}

.auth-input-icon i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-color);
  font-size: 1.2rem;
  pointer-events: none;
}

.auth-input-icon input {
  padding-left: 45px;
}

.auth-row {
  display: flex;
  gap: 15px;
}

.auth-row .form-group {
  flex: 1;
}

.auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-dark);
  font-size: 0.86rem;
  line-height: 1.5;
  cursor: pointer;
}

.auth-checkbox input {
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin-top: 3px;
  accent-color: var(--primary-color);
}

.auth-submit {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  margin-top: 10px;
}

.auth-forgot-row {
  text-align: right;
  margin-top: -6px;
  margin-bottom: 16px;
}

.auth-forgot-row a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
}

.auth-forgot-row a:hover {
  text-decoration: underline;
}

.auth-terms-button {
  border: none;
  background: none;
  padding: 0;
  color: var(--primary-color);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-terms-button:hover {
  color: #3158c9;
}

.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 27, 43, 0.55);
}

.auth-modal-backdrop.is-open {
  display: flex;
}

.auth-modal {
  width: 100%;
  max-width: 820px;
  max-height: 88vh;
  background: var(--sidebar-color);
  border-radius: 16px;
  border: 1px solid rgba(64, 112, 244, 0.16);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.auth-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-bottom: 1px solid #edf0f7;
}

.auth-modal-header h3 {
  color: var(--text-dark);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 4px 0;
}

.auth-modal-header p {
  color: var(--text-color);
  font-size: 0.85rem;
  margin: 0;
}

.auth-modal-close {
  border: none;
  background: var(--primary-color-light);
  color: var(--primary-color);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-modal-content {
  padding: 24px;
  max-height: 55vh;
  overflow-y: auto;
  color: var(--text-dark);
  font-size: 0.92rem;
  line-height: 1.75;
  background: #fbfcff;
}

.auth-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 24px;
  border-top: 1px solid #edf0f7;
  background: #fff;
}

.auth-terms-box {
  max-height: 520px;
  overflow-y: auto;
  border: 1px solid #e4e7f3;
  border-radius: 14px;
  padding: 20px;
  background: #fbfcff;
  color: var(--text-dark);
  line-height: 1.7;
  margin: 20px 0;
}

.auth-token-actions {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

@media (max-width: 700px) {
  body.auth-page {
    padding: 16px;
  }

  .auth-card {
    padding: 28px 22px;
  }

  .auth-row {
    display: block;
  }

  .auth-modal-backdrop {
    padding: 14px;
  }

  .auth-modal-header {
    padding: 18px;
  }

  .auth-modal-content {
    padding: 18px;
    max-height: 58vh;
  }

  .auth-modal-footer {
    padding: 16px 18px;
  }

  .auth-modal-footer .btn {
    width: 100%;
  }
}