/* ==============================================================================
   VENDIA AI — AUTHENTICATION & USER PROFILE STYLES
   Used by both index.html (Landing Page) & dashboard.html (Dashboard)
   ============================================================================== */

@font-face {
  font-family: 'Twemoji Country Flags';
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
  src: url('https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1/dist/TwemojiCountryFlags.woff2') format('woff2');
  font-display: swap;
}

/* Modal Backdrop */
.auth-modal-backdrop,
.profile-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 13, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal-backdrop.active,
.profile-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Modal Dialog */
.auth-dialog,
.profile-dialog {
  background: rgba(11, 17, 30, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.85),
    0 0 40px rgba(37, 211, 102, 0.12);
  transform: scale(0.95) translateY(12px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal-backdrop.active .auth-dialog,
.profile-modal-backdrop.active .profile-dialog {
  transform: scale(1) translateY(0);
}

/* Dialog Header */
.auth-dialog-header,
.profile-dialog-header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.auth-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-dialog-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 15px;
}

.auth-dialog-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Auth Tabs Navigation */
.auth-tabs-nav {
  display: flex;
  gap: 8px;
  background: rgba(18, 26, 44, 0.7);
  padding: 5px;
  border-radius: 12px;
  margin: 18px 28px 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab-btn.active {
  background: var(--whatsapp-green, #00c968);
  color: #051b11;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 201, 104, 0.35);
}

/* Dialog Body */
.auth-dialog-body,
.profile-dialog-body {
  padding: 22px 28px 28px;
}

/* Form Elements */
.auth-form-group,
.profile-form-group {
  margin-bottom: 16px;
}

.auth-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.auth-label,
.profile-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}

.auth-label .required,
.profile-label .required {
  color: #f43f5e;
  margin-left: 2px;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  color: #64748b;
  font-size: 14px;
  pointer-events: none;
}

.auth-input,
.profile-input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(16, 24, 40, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s ease;
}

.auth-input.has-icon {
  padding-left: 40px;
}

.auth-input:focus,
.profile-input:focus {
  outline: none;
  border-color: var(--whatsapp-green, #00c968);
  box-shadow: 0 0 0 3px rgba(0, 201, 104, 0.2);
  background: rgba(20, 30, 50, 0.95);
}

/* Password Toggle */
.password-toggle-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  font-size: 14px;
  transition: color 0.2s ease;
}

.password-toggle-btn:hover {
  color: #ffffff;
}

/* WhatsApp Phone Input Group */
.phone-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.country-flag-preview {
  width: 22px;
  height: 15px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  display: inline-block;
}

.country-code-select {
  width: 86px;
  min-width: 78px;
  max-width: 35%;
  flex-shrink: 0;
  padding: 12px 6px 12px 8px;
  background: rgba(16, 24, 40, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #ffffff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
}

.country-code-select:focus {
  border-color: var(--whatsapp-green, #00c968);
}

.country-code-select option {
  background: #0f172a;
  color: #ffffff;
}

/* Alert Banners */
.auth-alert {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 16px;
  display: none;
  align-items: center;
  gap: 10px;
}

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

.auth-alert.error {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fb7185;
}

.auth-alert.success {
  background: rgba(0, 201, 104, 0.12);
  border: 1px solid rgba(0, 201, 104, 0.35);
  color: #4ade80;
}

/* Action Button */
.btn-auth-submit {
  width: 100%;
  padding: 13px 20px;
  background: var(--whatsapp-green, #00c968);
  color: #051b11;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 18px rgba(0, 201, 104, 0.35);
  transition: all 0.25s ease;
  margin-top: 8px;
}

.btn-auth-submit:hover:not(:disabled) {
  background: #00e676;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0, 201, 104, 0.5);
}

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

/* Social Divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: #64748b;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-divider,
.auth-social-buttons,
#auth-social-section,
.btn-social,
#btn-oauth-google,
#btn-oauth-facebook {
  display: none !important;
}

.btn-social {
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 26, 44, 0.7);
  color: #f1f5f9;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.btn-social:hover {
  background: rgba(30, 42, 68, 0.9);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-social-google svg {
  width: 18px;
  height: 18px;
}

.btn-social-facebook i {
  color: #1877f2;
  font-size: 18px;
}

/* Footer Link */
.auth-footer-prompt {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: #94a3b8;
}

.auth-switch-link {
  color: var(--whatsapp-green, #00c968);
  font-weight: 600;
  cursor: pointer;
  margin-left: 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.auth-switch-link:hover {
  color: #00e676;
}

/* ==============================================================================
   PROFILE EDIT MODAL STYLES
   ============================================================================== */
.profile-avatar-section {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px;
  background: rgba(16, 24, 40, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  margin-bottom: 22px;
}

.profile-avatar-picker-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}

.avatar-preview-box {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.25), rgba(6, 182, 212, 0.25));
  border: 2.5px solid var(--whatsapp-green, #00c968);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.avatar-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-preview-initials {
  font-size: 28px;
  font-weight: 800;
  color: var(--whatsapp-green, #00c968);
}

.avatar-hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 20px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.profile-avatar-picker-wrap:hover .avatar-hover-overlay {
  opacity: 1;
}

.profile-avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-upload-photo {
  padding: 8px 14px;
  background: rgba(37, 211, 102, 0.15);
  border: 1px solid rgba(37, 211, 102, 0.4);
  color: var(--whatsapp-green, #00c968);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-upload-photo:hover {
  background: rgba(37, 211, 102, 0.25);
  border-color: var(--whatsapp-green, #00c968);
}

.btn-remove-photo {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-remove-photo:hover {
  background: rgba(244, 63, 94, 0.12);
  border-color: #f43f5e;
}

/* User avatar image in sidebar & topbar */
.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #0b111e;
}

/* Profile Modal Footer */
.profile-dialog-footer {
  padding: 18px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.btn-profile-cancel {
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-profile-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.btn-profile-save {
  padding: 10px 22px;
  background: var(--whatsapp-green, #00c968);
  border: none;
  color: #051b11;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 201, 104, 0.35);
  transition: all 0.2s ease;
}

.btn-profile-save:hover:not(:disabled) {
  background: #00e676;
  transform: translateY(-1px);
}

.btn-profile-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==============================================================================
   TOAST NOTIFICATION (GLOBAL)
   ============================================================================== */
.vendia-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(37, 211, 102, 0.4);
  border-radius: 14px;
  padding: 14px 20px;
  box-shadow: 
    0 12px 36px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(37, 211, 102, 0.2);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(30px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.vendia-toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.vendia-toast.error {
  border-color: rgba(244, 63, 94, 0.45);
  box-shadow: 
    0 12px 36px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(244, 63, 94, 0.2);
}

.vendia-toast .toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 600px) {
  .auth-form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .auth-social-buttons {
    grid-template-columns: 1fr;
  }
  .auth-dialog,
  .profile-dialog {
    max-width: 100%;
    margin: 10px;
    border-radius: 20px;
  }
  .auth-dialog-body,
  .profile-dialog-body {
    padding: 18px 20px 22px;
  }
  .auth-tabs-nav {
    margin: 14px 16px 0;
    gap: 6px;
    padding: 4px;
  }
  .auth-tab-btn {
    padding: 9px 8px;
    font-size: 13px;
    white-space: nowrap;
    text-align: center;
  }
  .auth-footer-prompt {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 6px;
    font-size: 12.5px;
    line-height: 1.4;
    text-align: center;
  }
  .auth-switch-link {
    white-space: nowrap;
    margin-left: 0;
  }
}

@media (max-width: 360px) {
  .auth-tabs-nav {
    margin: 12px 10px 0;
    gap: 4px;
    padding: 3px;
  }
  .auth-tab-btn {
    font-size: 12px;
    padding: 8px 4px;
  }
  .auth-footer-prompt {
    font-size: 12px;
  }
}
