/* ═══════════════════════════════════════════════ */
/* ✨ CLOUDÉ — Luxury Auth Modal Styles           */
/* ═══════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Inter:wght@300;400;500&display=swap');

/* ===== Modal Backdrop ===== */
.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(5, 5, 8, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* ===== Modal Container ===== */
.auth-modal {
  position: relative;
  width: 420px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(
    145deg,
    rgba(15, 12, 18, 0.95) 0%,
    rgba(20, 16, 24, 0.92) 50%,
    rgba(12, 10, 16, 0.95) 100%
  );
  border: 1px solid rgba(201, 133, 149, 0.15);
  border-radius: 16px;
  padding: 0;
  transform: translateY(30px) scale(0.95);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(201, 133, 149, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

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

/* Custom scrollbar */
.auth-modal::-webkit-scrollbar { width: 3px; }
.auth-modal::-webkit-scrollbar-track { background: transparent; }
.auth-modal::-webkit-scrollbar-thumb { background: rgba(201, 133, 149, 0.2); border-radius: 3px; }

/* ===== Modal Header ===== */
.auth-modal-header {
  text-align: center;
  padding: 40px 36px 20px;
  position: relative;
}

.auth-modal-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(201, 133, 149, 0.5), transparent);
  border-radius: 2px;
}

.auth-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 300;
  color: #e8ddd3;
  letter-spacing: 10px;
  margin-bottom: 4px;
}

.auth-brand-sub {
  font-family: 'Inter', sans-serif;
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 5px;
  color: rgba(201, 133, 149, 0.6);
  text-transform: uppercase;
}

.auth-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 400;
  color: #e8ddd3;
  margin-top: 24px;
  letter-spacing: 1px;
}

.auth-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: rgba(168, 154, 142, 0.7);
  margin-top: 8px;
  line-height: 1.6;
}

/* ===== Divider ===== */
.auth-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 133, 149, 0.15), transparent);
  margin: 0;
}

/* ===== Form Body ===== */
.auth-modal-body {
  padding: 28px 36px 36px;
}

/* ===== Tabs ===== */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  border: 1px solid rgba(201, 133, 149, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.auth-tab {
  flex: 1;
  padding: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(168, 154, 142, 0.5);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.auth-tab.active {
  color: #e8ddd3;
  background: rgba(201, 133, 149, 0.1);
}

.auth-tab:hover:not(.active) {
  color: rgba(168, 154, 142, 0.8);
  background: rgba(201, 133, 149, 0.04);
}

/* ===== Form Groups ===== */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-form-group {
  position: relative;
}

.auth-form-group label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(168, 154, 142, 0.5);
  margin-bottom: 8px;
}

.auth-form-group input,
.auth-form-group select {
  width: 100%;
  padding: 14px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #e8ddd3;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(201, 133, 149, 0.12);
  border-radius: 8px;
  outline: none;
  transition: all 0.3s ease;
  -webkit-appearance: none;
}

.auth-form-group input::placeholder {
  color: rgba(168, 154, 142, 0.3);
  font-weight: 300;
}

.auth-form-group input:focus,
.auth-form-group select:focus {
  border-color: rgba(201, 133, 149, 0.35);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 20px rgba(201, 133, 149, 0.06);
}

.auth-form-group select option {
  background: #0f0c12;
  color: #e8ddd3;
}

/* ===== Optional Fields Row ===== */
.auth-row {
  display: flex;
  gap: 12px;
}

.auth-row .auth-form-group {
  flex: 1;
}

/* ===== Submit Button ===== */
.auth-submit-btn {
  width: 100%;
  padding: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, #c98595 0%, #b07085 50%, #a06075 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
  margin-top: 6px;
}

.auth-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(201, 133, 149, 0.25);
}

.auth-submit-btn:active {
  transform: translateY(0);
}

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

/* Loading state */
.auth-submit-btn.loading {
  pointer-events: none;
  color: transparent;
}

.auth-submit-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: authSpin 0.6s linear infinite;
}

@keyframes authSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===== Error / Success Messages ===== */
.auth-message {
  padding: 12px 16px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  text-align: center;
  margin-bottom: 16px;
  display: none;
}

.auth-message.error {
  display: block;
  background: rgba(220, 50, 50, 0.1);
  border: 1px solid rgba(220, 50, 50, 0.2);
  color: #e87070;
}

.auth-message.success {
  display: block;
  background: rgba(50, 200, 100, 0.1);
  border: 1px solid rgba(50, 200, 100, 0.2);
  color: #70e890;
}

/* ===== Skip / Guest ===== */
.auth-skip {
  display: block;
  text-align: center;
  margin-top: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: rgba(168, 154, 142, 0.4);
  cursor: pointer;
  border: none;
  background: none;
  letter-spacing: 1px;
  transition: color 0.3s ease;
  width: 100%;
}

.auth-skip:hover {
  color: rgba(168, 154, 142, 0.7);
}

/* ===== Footer text ===== */
.auth-footer-text {
  text-align: center;
  margin-top: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  color: rgba(168, 154, 142, 0.3);
  line-height: 1.6;
}

/* ===== Signup extra fields ===== */
.auth-extra-fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.4s ease;
}

.auth-extra-fields.visible {
  max-height: 300px;
  opacity: 1;
}

/* ===== Nav Account Wrapper ===== */
.nav-account-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

/* ===== User Badge (after login) ===== */
.auth-user-badge {
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);    /* appears to the LEFT of the account icon */
  transform: translateY(-50%) translateX(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 10px;
  background: rgba(15, 12, 18, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(201, 133, 149, 0.2);
  border-radius: 30px;
  cursor: pointer;
  white-space: nowrap;
  /* Hidden by default */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

/* Visible state (set by JS on login for 3s, then on hover) */
.auth-user-badge.badge-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

.auth-user-badge:hover {
  border-color: rgba(201, 133, 149, 0.35);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* ===== Avatar ===== */
.auth-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c98595, #b07085);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

/* ===== Name ===== */
.auth-user-name {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: #e8ddd3;
  letter-spacing: 0.5px;
}

/* ===== Dropdown ===== */
.auth-user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 200px;
  background: rgba(15, 12, 18, 0.97);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(201, 133, 149, 0.14);
  border-radius: 12px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
  pointer-events: none;
}

.auth-user-badge.open .auth-user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* ===== Dropdown items ===== */
.auth-dropdown-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: rgba(232, 221, 211, 0.7);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
}
.auth-dropdown-item:hover {
  background: rgba(201, 133, 149, 0.08);
  color: #e8ddd3;
}
.auth-dropdown-item.logout {
  border-top: 1px solid rgba(201, 133, 149, 0.1);
  color: rgba(220, 100, 100, 0.7);
}
.auth-dropdown-item.logout:hover {
  color: #dc6464;
  background: rgba(220, 100, 100, 0.06);
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .auth-modal { max-width: 96vw; border-radius: 12px; }
  .auth-modal-header { padding: 30px 24px 16px; }
  .auth-modal-body { padding: 20px 24px 28px; }
  .auth-brand { font-size: 26px; letter-spacing: 8px; }
  .auth-row { flex-direction: column; }
  /* On mobile badge goes below the icon */
  .auth-user-badge {
    position: fixed;
    top: 12px;
    right: 60px;
    transform: translateY(0) translateX(8px);
  }
  .auth-user-badge.badge-visible {
    transform: translateY(0) translateX(0);
  }
}
