/* NAFH Auth Pages - v2.4.1 - High specificity to override WP themes */

/* Base container - use ID + class for max specificity */
body .nafh-auth-page,
body .nafh-auth-page *,
#nafh-parent-login-form,
#nafh-parent-register-form,
#nafh-staff-login-form,
#nafh-staff-register-form {
  box-sizing: border-box !important;
}

body .nafh-auth-page {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif !important;
  direction: rtl !important;
  text-align: right !important;
  min-height: 100vh !important;
  background: #f0f5f0 !important;
  color: #1f2937 !important;
  line-height: 1.6 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Top Navigation Bar */
body .nafh-auth-page .nafh-auth-topbar {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 14px 32px !important;
  background: #fff !important;
  border-bottom: 1px solid #e5e7eb !important;
  font-size: 0.9em !important;
  margin: 0 !important;
}
body .nafh-auth-page .nafh-auth-topbar-title {
  font-weight: 600 !important;
  color: #1f2937 !important;
}
body .nafh-auth-page .nafh-auth-topbar-link {
  color: #166534 !important;
  text-decoration: underline !important;
  font-weight: 500 !important;
  cursor: pointer !important;
}

/* Hero Section */
body .nafh-auth-page .nafh-auth-hero {
  text-align: center !important;
  padding: 60px 20px 30px !important;
  background: transparent !important;
}
body .nafh-auth-page .nafh-auth-icon {
  width: 72px !important;
  height: 72px !important;
  margin: 0 auto 20px !important;
  background: #dcfce7 !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 2em !important;
}
body .nafh-auth-page .nafh-auth-icon svg {
  width: 36px !important;
  height: 36px !important;
  fill: #166534 !important;
}
body .nafh-auth-page .nafh-auth-hero h1 {
  font-size: 1.6em !important;
  font-weight: 700 !important;
  color: #111827 !important;
  margin: 0 0 6px !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
}
body .nafh-auth-page .nafh-auth-hero p {
  font-size: 0.95em !important;
  color: #6b7280 !important;
  margin: 0 !important;
}

/* Card */
body .nafh-auth-page .nafh-auth-card {
  max-width: 520px !important;
  margin: 0 auto 40px !important;
  background: #fff !important;
  border-radius: 16px !important;
  padding: 36px 40px !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06) !important;
  border: none !important;
}
body .nafh-auth-page .nafh-auth-card h2 {
  text-align: center !important;
  font-size: 1.25em !important;
  font-weight: 700 !important;
  color: #111827 !important;
  margin: 0 0 24px !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
}

/* Form Fields */
body .nafh-auth-page .nafh-auth-field {
  margin-bottom: 18px !important;
  padding: 0 !important;
}
body .nafh-auth-page .nafh-auth-label {
  display: block !important;
  font-size: 0.88em !important;
  font-weight: 600 !important;
  color: #374151 !important;
  margin-bottom: 6px !important;
  text-align: right !important;
}

/* INPUT - highest specificity */
body .nafh-auth-page .nafh-auth-card input.nafh-auth-input,
body .nafh-auth-page .nafh-auth-card input[type="text"].nafh-auth-input,
body .nafh-auth-page .nafh-auth-card input[type="tel"].nafh-auth-input,
body .nafh-auth-page .nafh-auth-card input[type="password"].nafh-auth-input,
body .nafh-auth-page .nafh-auth-card input[type="email"].nafh-auth-input,
body .nafh-auth-page input.nafh-auth-input {
  width: 100% !important;
  padding: 14px 16px !important;
  border: 1.5px solid #d1d5db !important;
  border-radius: 10px !important;
  font-size: 1em !important;
  background: #f8fafc !important;
  direction: rtl !important;
  text-align: right !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  height: auto !important;
  line-height: 1.5 !important;
  margin: 0 !important;
  font-family: inherit !important;
  color: #1f2937 !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
}
body .nafh-auth-page input.nafh-auth-input:focus {
  border-color: #166534 !important;
  box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.12) !important;
  background: #fff !important;
}
body .nafh-auth-page input.nafh-auth-input::placeholder {
  color: #9ca3af !important;
}

/* OTP Input */
body .nafh-auth-page input.nafh-auth-otp-input {
  width: 200px !important;
  padding: 16px !important;
  border: 2.5px solid #166534 !important;
  border-radius: 10px !important;
  font-size: 1.6em !important;
  text-align: center !important;
  letter-spacing: 10px !important;
  font-weight: 700 !important;
  direction: ltr !important;
  margin: 0 auto 16px !important;
  display: block !important;
  outline: none !important;
  background: #fff !important;
  color: #166534 !important;
}
body .nafh-auth-page input.nafh-auth-otp-input:focus {
  box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.15) !important;
}

/* BUTTON - highest specificity */
body .nafh-auth-page .nafh-auth-card button.nafh-auth-btn,
body .nafh-auth-page button.nafh-auth-btn,
body .nafh-auth-page .nafh-auth-btn {
  width: 100% !important;
  padding: 14px 20px !important;
  background: #166534 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  font-size: 1.05em !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  margin-top: 8px !important;
  display: block !important;
  text-align: center !important;
  line-height: 1.5 !important;
  font-family: inherit !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  box-shadow: 0 2px 8px rgba(22,101,52,0.2) !important;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s !important;
}
body .nafh-auth-page button.nafh-auth-btn:hover {
  background: #14532d !important;
  box-shadow: 0 4px 12px rgba(22,101,52,0.3) !important;
}
body .nafh-auth-page button.nafh-auth-btn:active {
  transform: scale(0.98) !important;
}
body .nafh-auth-page button.nafh-auth-btn:disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
}

/* Hint text */
body .nafh-auth-page .nafh-auth-hint {
  font-size: 0.78em !important;
  color: #6b7280 !important;
  margin-top: 4px !important;
}

/* Links Row */
body .nafh-auth-page .nafh-auth-links {
  display: flex !important;
  justify-content: space-between !important;
  margin-top: 16px !important;
  font-size: 0.88em !important;
}
body .nafh-auth-page .nafh-auth-link,
body .nafh-auth-page a.nafh-auth-link {
  color: #166534 !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  cursor: pointer !important;
}
body .nafh-auth-page a.nafh-auth-link:hover {
  text-decoration: underline !important;
  color: #14532d !important;
}
body .nafh-auth-page .nafh-auth-center-link {
  text-align: center !important;
  margin-top: 16px !important;
  font-size: 0.88em !important;
  color: #6b7280 !important;
}
body .nafh-auth-page .nafh-auth-center-link a {
  color: #166534 !important;
  text-decoration: none !important;
  font-weight: 500 !important;
}

/* Error / Success Messages */
body .nafh-auth-page .nafh-auth-msg {
  padding: 10px 14px !important;
  border-radius: 8px !important;
  font-size: 0.88em !important;
  margin-bottom: 16px !important;
  display: none !important;
}
body .nafh-auth-page .nafh-auth-msg.error {
  background: #fef2f2 !important;
  color: #991b1b !important;
  border: 1px solid #fecaca !important;
  display: block !important;
}
body .nafh-auth-page .nafh-auth-msg.success {
  background: #f0fdf4 !important;
  color: #166534 !important;
  border: 1px solid #bbf7d0 !important;
  display: block !important;
}

/* OTP Section */
body .nafh-auth-page .nafh-auth-otp-section {
  text-align: center !important;
  padding: 20px 0 !important;
}
body .nafh-auth-page .nafh-auth-otp-section p {
  font-size: 0.9em !important;
  color: #6b7280 !important;
  margin-bottom: 16px !important;
}

/* Resend link */
body .nafh-auth-page .nafh-auth-resend {
  font-size: 0.85em !important;
  color: #6b7280 !important;
  margin-top: 12px !important;
}
body .nafh-auth-page .nafh-auth-resend a {
  color: #166534 !important;
  cursor: pointer !important;
  text-decoration: none !important;
  font-weight: 500 !important;
}
body .nafh-auth-page .nafh-auth-resend a.disabled {
  color: #9ca3af !important;
  pointer-events: none !important;
}

/* Timer */
body .nafh-auth-page .nafh-auth-timer {
  font-size: 0.85em !important;
  color: #d97706 !important;
  margin-top: 8px !important;
}

/* HIDDEN - absolute highest priority */
body .nafh-auth-page .nafh-auth-hidden,
.nafh-auth-page .nafh-auth-hidden,
.nafh-auth-hidden {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Responsive */
@media (max-width: 600px) {
  body .nafh-auth-page .nafh-auth-topbar {
    padding: 12px 16px !important;
    font-size: 0.82em !important;
  }
  body .nafh-auth-page .nafh-auth-hero {
    padding: 40px 16px 20px !important;
  }
  body .nafh-auth-page .nafh-auth-hero h1 {
    font-size: 1.3em !important;
  }
  body .nafh-auth-page .nafh-auth-card {
    margin: 0 12px 30px !important;
    padding: 24px 20px !important;
    border-radius: 12px !important;
  }
  body .nafh-auth-page .nafh-auth-links {
    flex-direction: column !important;
    gap: 8px !important;
    align-items: center !important;
  }
}
