/* ============================================
   auth.css - login & register pages
   Light theme. Requires: main.css
   ============================================ */

/* ── AUTH LAYOUT ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--bg);
}

/* ── AUTH CARD ── */
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}

/* ── AUTH HEADER ── */
.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.auth-logo-text {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.auth-logo-text span {
  color: var(--blue-light);
}

.auth-title {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
  text-align: center;
  color: var(--text-primary);
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
  margin-bottom: 2rem;
}

/* ── AUTH FORM ── */
.auth-form {
  display: flex;
  flex-direction: column;
}

.auth-form .form-group {
  margin-bottom: 1.1rem;
}

.auth-form .form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.auth-form .form-input {
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.925rem;
  padding: 0.8rem 1rem;
}

.auth-form .form-input::placeholder {
  color: var(--text-hint);
}

.auth-form .form-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  outline: none;
}

/* password toggle wrapper */
.input-wrap {
  position: relative;
}

.input-wrap .form-input {
  padding-right: 2.75rem;
}

.toggle-pw {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-hint);
  cursor: pointer;
  font-size: 1rem;
  transition: color var(--transition);
  line-height: 1;
}

.toggle-pw:hover {
  color: var(--text-primary);
}

/* ── SUBMIT BUTTON ── */
.auth-submit {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.875rem;
  width: 100%;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  margin-top: 0.5rem;
}

.auth-submit:hover {
  background: var(--blue-light);
  transform: translateY(-1px);
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-submit.loading {
  position: relative;
  color: transparent;
}

.auth-submit.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── DIVIDER ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  color: var(--text-hint);
  font-size: 0.78rem;
}

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

/* ── FOOTER LINK ── */
.auth-footer {
  text-align: center;
  margin-top: 1.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--blue);
  font-weight: 600;
  transition: color var(--transition);
}

.auth-footer a:hover {
  color: var(--blue-light);
}

/* ── ALERT inside auth card ── */
.auth-alert {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  display: none;
}

.auth-alert.show {
  display: block;
}

.auth-alert.error {
  background: var(--red-soft);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: var(--red);
}

.auth-alert.success {
  background: var(--green-soft);
  border: 1px solid rgba(22, 163, 74, 0.25);
  color: var(--green);
}

/* ── ROLE HINT (register page) ── */
.role-hint {
  background: var(--blue-soft);
  border: 1px solid rgba(79, 70, 229, 0.15);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.55;
}

.role-hint strong {
  color: var(--text-primary);
}

/* ── 768px ── */
@media (max-width: 768px) {
  .auth-card {
    padding: 2rem;
  }
}

/* ── 480px ── */
@media (max-width: 480px) {
  .auth-card {
    padding: 1.5rem;
    border-radius: 12px;
  }

  .auth-title {
    font-size: 1.3rem;
  }

  .auth-subtitle {
    font-size: 0.82rem;
  }
}