/* ==========================================================================
   ENFA Client UX Audit Fixes
   Profile Modal — Login & Register polish
   ========================================================================== */

/* ------------------------------------------------------------------
   Modal container & overlay
   ------------------------------------------------------------------ */
.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.profile-modal.active {
  display: flex;
}

.profile-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.profile-modal-content {
  position: relative;
  width: min(520px, 95vw);
  max-height: 95vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 20px;
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
  z-index: 1;
  animation: profileModalIn 0.25s ease-out;
}

@keyframes profileModalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.profile-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 2;
}

.profile-modal-close:hover {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}

/* ------------------------------------------------------------------
   Header — Title & subtitle
   ------------------------------------------------------------------ */
.profile-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.profile-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  font-style: normal;
  color: #1e293b;
  margin: 0 0 0.35rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.profile-subheading {
  color: #64748b;
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.4;
}

/* Vue login modal contrast hardening */
.vue-profile-modal h2 {
  color: #0f172a !important;
  font-weight: 800 !important;
}

.vue-profile-modal-close {
  color: #475569 !important;
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
}

.vue-profile-modal .form-group label {
  color: #334155 !important;
}

.vue-profile-modal .form-group input {
  color: #0f172a !important;
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}

/* ------------------------------------------------------------------
   Tabs — Login / Register switcher
   ------------------------------------------------------------------ */
.profile-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 4px;
}

.profile-tab {
  flex: 1;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-tab:hover {
  color: #334155;
}

.profile-tab.active {
  background: #ffffff;
  color: #ff6b35;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ------------------------------------------------------------------
   Form styles — shared between login & register
   ------------------------------------------------------------------ */
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-form .form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.3;
}

.profile-form .form-group input[type="text"],
.profile-form .form-group input[type="email"],
.profile-form .form-group input[type="password"],
.profile-form .form-group input[type="tel"] {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  font-size: 0.95rem;
  color: #1e293b;
  background: #ffffff;
  transition: all 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.profile-form .form-group input:focus {
  border-color: #ff6b35;
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12);
}

.profile-form .form-group input::placeholder {
  color: #94a3b8;
}

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

.password-input-wrapper input {
  padding-right: 2.75rem !important;
}

.password-toggle {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.3rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: #64748b;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

/* Password strength bar */
.password-strength {
  height: 4px;
  border-radius: 99px;
  background: #e2e8f0;
  margin-top: 0.35rem;
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  border-radius: 99px;
  width: 0;
  transition: width 0.3s ease, background 0.3s ease;
}

.password-strength-bar.weak {
  width: 33%;
  background: #ef4444;
}

.password-strength-bar.medium {
  width: 66%;
  background: #f59e0b;
}

.password-strength-bar.strong {
  width: 100%;
  background: #22c55e;
}

/* Password requirements */
.password-requirements {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.password-requirements .req {
  font-size: 0.75rem;
  color: #94a3b8;
  transition: color 0.2s ease;
}

.password-requirements .req.met {
  color: #22c55e;
}

/* Phone input */
.phone-input-container {
  display: flex;
  gap: 0;
  align-items: stretch;
}

.country-code-selector {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.7rem 0.75rem;
  background: #f1f5f9;
  border: 1.5px solid #d1d5db;
  border-right: none;
  border-radius: 10px 0 0 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
}

.phone-input-container input[type="tel"] {
  border-radius: 0 10px 10px 0 !important;
}

.phone-input-hint {
  color: #94a3b8;
  font-size: 0.78rem;
  margin-top: 0.25rem;
  display: block;
}

/* Checkbox group */
.checkbox-group {
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 0.5rem !important;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #ff6b35;
  flex-shrink: 0;
}

.checkbox-group label {
  font-size: 0.82rem !important;
  font-weight: 400 !important;
  color: #64748b !important;
  line-height: 1.4;
}

.checkbox-group label a {
  color: #ff6b35;
  text-decoration: none;
  font-weight: 600;
}

.checkbox-group label a:hover {
  text-decoration: underline;
}

/* Submit buttons */
.profile-form .btn-primary {
  width: 100%;
  padding: 0.8rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff8c5a 0%, #ff6b35 100%);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.profile-form .btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #ff6b35 0%, #ea580c 100%);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.3);
  transform: translateY(-1px);
}

.profile-form .btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* Forgot password link */
.forgot-password-btn-style {
  margin-top: 0.5rem;
  padding: 0;
  text-align: center;
  background: none;
  border: none;
  color: #ff6b35;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.forgot-password-btn-style:hover {
  color: #ea580c;
  text-decoration: underline;
}

/* Form feedback messages */
.form-feedback {
  display: none;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  margin-top: 0.25rem;
}

.form-feedback.success {
  display: block;
  background: #dcfce7;
  color: #15803d;
}

.form-feedback.error {
  display: block;
  background: #fef2f2;
  color: #b91c1c;
}

/* ------------------------------------------------------------------
   Back button (personal info view)
   ------------------------------------------------------------------ */
.back-to-profile-btn {
  position: absolute;
  left: 1rem;
  top: 1rem;
}

/* ------------------------------------------------------------------
   Mobile adjustments
   ------------------------------------------------------------------ */
@media (max-width: 480px) {
  .profile-modal-content {
    padding: 1.5rem 1.25rem 1.25rem;
    border-radius: 16px;
    max-height: 92vh;
  }

  .profile-header h2 {
    font-size: 1.3rem;
  }

  .profile-tabs {
    margin-bottom: 1.25rem;
  }

  .profile-tab {
    font-size: 0.88rem;
    padding: 0.55rem 0.75rem;
  }
}
/* ============================================
   CHECKOUT PREFERENCE OVERLAY FIX
   Force hide the floating payment buttons when not active
   ============================================ */
[id="checkout-preference-overlay"][aria-hidden="true"],
.checkout-preference[aria-hidden="true"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

[id="checkout-preference-overlay"]:not([aria-hidden="true"]),
.checkout-preference:not([aria-hidden="true"]) {
  display: flex !important;
}
