/* ============================================================
   PetHub.pet — Auth / Registration Modal
   Structure: css/modal.css
   ============================================================ */

/* OVERLAY
   ============================================================ */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(5, 8, 12, 0.88);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* MODAL CARD
   ============================================================ */
.auth-modal {
  background: #111820;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 28px;
  padding: 40px;
  width: 100%;
  max-width: 560px;
  position: relative;
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(111, 143, 59, 0.08);
  transform: translateY(24px) scale(0.98);
  transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 92vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(111, 143, 59, 0.25) transparent;
}

.auth-overlay.open .auth-modal {
  transform: translateY(0) scale(1);
}

.auth-modal::-webkit-scrollbar {
  width: 4px;
}
.auth-modal::-webkit-scrollbar-track {
  background: transparent;
}
.auth-modal::-webkit-scrollbar-thumb {
  background: rgba(111, 143, 59, 0.3);
  border-radius: 2px;
}

/* CLOSE
   ============================================================ */
.auth-close {
  position: absolute;
  top: 18px;
  right: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #8b95a1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  line-height: 1;
}
.auth-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

/* LOGO
   ============================================================ */
.auth-modal-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 30px;
}
.auth-modal-logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(111, 143, 59, 0.45));
}
.auth-modal-logo span {
  color: white;
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.5px;
}
.auth-modal-logo strong {
  color: var(--primary);
  font-weight: 700;
}

/* STEP HEADER
   ============================================================ */
.auth-step-header {
  margin-bottom: 26px;
}
.auth-step-header h2 {
  color: white;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.auth-step-header p {
  color: #8b95a1;
  font-size: 0.9rem;
  line-height: 1.55;
}
.auth-step-header p strong {
  color: var(--primary);
  font-weight: 600;
}

/* BACK BUTTON
   ============================================================ */
.auth-back {
  background: none;
  border: none;
  color: #8b95a1;
  font-size: 0.84rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 18px;
  font-family: 'Poppins', sans-serif;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.auth-back:hover {
  color: white;
}

/* STEP TRANSITIONS
   ============================================================ */
.auth-step {
  display: none;
}
.auth-step.active {
  display: block;
  animation: stepIn 0.3s ease both;
}

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ROLE CARDS
   ============================================================ */
.role-grid {
  display: grid;
  gap: 14px;
}

.role-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 22px 20px 22px 22px;
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: all 0.24s ease;
  position: relative;
  font-family: 'Poppins', sans-serif;
}
.role-card:hover {
  background: rgba(111, 143, 59, 0.07);
  border-color: rgba(111, 143, 59, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.role-emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 12px;
}
.role-card h3 {
  color: white;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 5px;
}
.role-card p {
  color: #7a8693;
  font-size: 0.84rem;
  line-height: 1.5;
  padding-right: 32px;
}
.role-arrow {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 1.1rem;
  transition: transform 0.22s ease;
}
.role-card:hover .role-arrow {
  transform: translateY(-50%) translateX(5px);
}

/* SERVICE TYPE GRID
   ============================================================ */
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.service-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 18px 10px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  transition: all 0.22s ease;
}
.service-card:hover {
  background: rgba(111, 143, 59, 0.09);
  border-color: rgba(111, 143, 59, 0.35);
}
.service-card.selected {
  background: rgba(111, 143, 59, 0.14);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(111, 143, 59, 0.15);
}
.service-card .svc-emoji {
  font-size: 1.8rem;
  display: block;
}
.service-card .svc-label {
  color: #c0cad3;
  font-size: 0.8rem;
  font-weight: 500;
}
.service-card.selected .svc-label {
  color: var(--primary);
}

/* FORM ELEMENTS
   ============================================================ */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.form-group label {
  color: #6b7a8a;
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.form-group input,
.form-group textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 12px 14px;
  color: white;
  font-family: 'Poppins', sans-serif;
  font-size: 0.91rem;
  width: 100%;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #3a4556;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(111, 143, 59, 0.05);
  box-shadow: 0 0 0 3px rgba(111, 143, 59, 0.12);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* FORM ERROR
   ============================================================ */
.form-error {
  font-size: 0.84rem;
  min-height: 20px;
  margin-bottom: 12px;
  line-height: 1.4;
  color: #f87171;
}
.form-error.success-msg {
  color: #4ade80;
}

/* SUBMIT BUTTON
   ============================================================ */
.auth-submit {
  width: 100%;
  padding: 14px 20px;
  border-radius: 50px;
  border: none;
  background: linear-gradient(135deg, #6f8f3b 0%, #4a6127 100%);
  color: white;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
  letter-spacing: 0.2px;
}
.auth-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #89ab50 0%, #5d7831 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(111, 143, 59, 0.32);
}
.auth-submit:active:not(:disabled) {
  transform: translateY(0);
}
.auth-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* SPINNER
   ============================================================ */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* DIVIDER
   ============================================================ */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
}
.auth-divider span {
  color: #4a5568;
  font-size: 0.78rem;
  white-space: nowrap;
}

/* FORGOT PASSWORD
   ============================================================ */
.forgot-link {
  display: block;
  text-align: center;
  color: #8b95a1;
  font-size: 0.84rem;
  margin-top: 14px;
  transition: color 0.2s;
}
.forgot-link:hover {
  color: var(--primary);
}

/* SUCCESS
   ============================================================ */
.success-wrap {
  text-align: center;
  padding: 24px 0 8px;
}
.success-ring {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 26px;
  animation: successPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  box-shadow: 0 0 40px rgba(111, 143, 59, 0.25);
}
.success-check {
  font-size: 2.3rem;
  color: var(--primary);
  font-weight: 700;
}
@keyframes successPop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.success-wrap h2 {
  color: white;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}
.success-wrap p {
  color: #8b95a1;
  line-height: 1.75;
  margin-bottom: 28px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
  font-size: 0.92rem;
}

/* AUTH TOGGLE FOOTER
   ============================================================ */
.auth-toggle {
  text-align: center;
  margin-top: 24px;
  color: #6b7a8a;
  font-size: 0.86rem;
}
.auth-toggle a {
  color: var(--primary);
  font-weight: 600;
  margin-left: 5px;
  transition: color 0.2s;
}
.auth-toggle a:hover {
  color: #89ab50;
}

/* UTILITY
   ============================================================ */
.hidden {
  display: none !important;
}

/* RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  .auth-modal {
    padding: 30px 22px 28px;
    border-radius: 22px;
    max-height: 95vh;
  }
  .auth-step-header h2 {
    font-size: 1.45rem;
  }
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .role-card p {
    padding-right: 28px;
  }
}