/* ── AUTH MODAL ────────────────────────────────────────────────── */

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.50);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.auth-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.auth-modal-card {
  background: #ffffff;
  border-radius: 24px;
  width: 100%;
  max-width: 530px;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.06),
    0 16px 48px rgba(0, 0, 0, 0.18);
  transform: translateY(18px) scale(0.99);
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  scrollbar-width: none;
}

.auth-modal-card::-webkit-scrollbar { display: none; }

.auth-modal-overlay.open .auth-modal-card {
  transform: translateY(0) scale(1);
}

/* Close button */
.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1A1A1A;
  color: #fff;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 14px;
  z-index: 10;
  line-height: 1;
  font-family: inherit;
}

.auth-modal-close:hover { background: #333; }

/* Body */
.auth-modal-body {
  padding: 44px 40px 0;
}

@media (max-width: 480px) {
  .auth-modal-body { padding: 36px 24px 0; }
}

.auth-modal-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: #1A1A1A;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 10px;
  text-align: center;
}

.auth-modal-subtitle {
  font-size: 0.93rem;
  color: #6B7280;
  line-height: 1.65;
  text-align: center;
  margin: 0 0 28px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

/* Google button */
.auth-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1.5px solid #E5E7EB;
  background: #fff;
  cursor: pointer;
  margin: 0 auto 20px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-google-btn:hover {
  border-color: #D1D5DB;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.auth-google-btn svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* OR divider */
.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  color: #9CA3AF;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.auth-or::before,
.auth-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #E5E7EB;
}

/* Form layout */
.auth-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

@media (max-width: 480px) {
  .auth-form-row { grid-template-columns: 1fr; gap: 0; margin-bottom: 0; }
}

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

.auth-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}

.auth-field input {
  width: 100%;
  background: #F3F2F7;
  border: none;
  border-radius: 999px;
  padding: 14px 20px;
  font-size: 0.95rem;
  color: #1A1A1A;
  outline: none;
  font-family: inherit;
  transition: background 0.15s;
  box-sizing: border-box;
  -webkit-appearance: none;
}

.auth-field input:focus {
  background: #ECEAF3;
}

.auth-field input::placeholder {
  color: #9CA3AF;
}

/* Password with toggle */
.auth-pw-wrap {
  position: relative;
}

.auth-pw-wrap input {
  padding-right: 50px;
}

.auth-pw-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #9CA3AF;
  display: grid;
  place-items: center;
  padding: 4px;
  line-height: 0;
}

.auth-pw-toggle:hover { color: #6B7280; }

/* Remember me row */
.auth-remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.auth-remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #374151;
  cursor: pointer;
}

.auth-forgot-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: #7C2D12;
  text-decoration: none;
}

.auth-forgot-link:hover { color: #9a3412; text-decoration: underline; }

/* Terms */
.auth-terms-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 0.86rem;
  color: #374151;
  line-height: 1.58;
}

.auth-terms-row input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: #7C2D12;
}

.auth-terms-row a {
  color: #7C2D12;
  text-decoration: underline;
}

/* Submit */
.auth-submit-btn {
  width: 100%;
  background: #7C2D12;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 16px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 32px;
  transition: background 0.18s, opacity 0.18s;
  font-family: inherit;
  letter-spacing: -0.01em;
}

.auth-submit-btn:hover { background: #6b2810; }
.auth-submit-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Error message */
.auth-error {
  background: #FEF2F2;
  color: #DC2626;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 0.88rem;
  margin-bottom: 16px;
  line-height: 1.5;
  display: none;
}

.auth-error.visible { display: block; }

/* Footer */
.auth-modal-footer {
  background: #FEF3EE;
  border-radius: 0 0 24px 24px;
  padding: 18px 40px;
  text-align: center;
  font-size: 0.9rem;
  color: #374151;
  font-weight: 500;
}

.auth-modal-footer a {
  color: #7C2D12;
  font-weight: 700;
  text-decoration: none;
}

.auth-modal-footer a:hover { text-decoration: underline; }

/* Screen switching */
.auth-screen { display: none; }
.auth-screen.active { display: block; }

/* Account type role selector */
.auth-role-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.auth-role-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px solid #E5E7EB;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  color: #6B7280;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.auth-role-btn.active {
  border-color: #7C2D12;
  color: #7C2D12;
  background: #FEF3EE;
}

.auth-role-btn:hover:not(.active) {
  border-color: #D1D5DB;
  color: #374151;
}
