/* ---------- AUTH PAGES ---------- */
.auth-main {
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: center;
  padding: 60px 0;
  background:
    radial-gradient(ellipse at 20% -10%, rgba(124, 34, 51, 0.10), transparent 55%),
    radial-gradient(ellipse at 90% 10%, rgba(195, 154, 75, 0.16), transparent 50%),
    var(--cream);
}
.auth-wrap { display: flex; justify-content: center; }
.auth-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
}
.auth-card h1 {
  font-size: 1.9rem;
  margin-bottom: 10px;
}
.auth-form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}
.hint {
  font-size: 0.8rem;
  color: var(--ink-soft);
  opacity: 0.8;
}
.whoami {
  font-weight: 600;
  color: var(--wine);
  margin-right: 8px;
}

/* ---------- PROFILE PAGE ---------- */
.profile-main {
  padding: 70px 0 100px;
}
.profile-main h1 { font-size: clamp(1.7rem, 3.4vw, 2.2rem); }

.media-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 40px;
}
.media-block {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}
.media-block h2 {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.media-block h2 .count {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold);
  background: rgba(195, 154, 75, 0.14);
  padding: 3px 10px;
  border-radius: 999px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}
.media-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.media-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.single-slot { margin: 16px 0; }
.single-slot audio,
.single-slot video {
  width: 100%;
  border-radius: 10px;
  background: var(--wood-2);
}
.single-slot video { max-height: 240px; }

.remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(43, 33, 24, 0.72);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.remove-btn.inline {
  position: static;
  width: auto;
  height: auto;
  border-radius: 999px;
  padding: 8px 16px;
  margin-top: 10px;
  font-size: 0.85rem;
  background: transparent;
  color: var(--wine);
  border: 1px solid var(--line);
}
.remove-btn.inline:hover { border-color: var(--wine); }

.media-list-item { margin-bottom: 16px; }
.media-list-item:last-child { margin-bottom: 0; }

.upload-btn {
  display: block;
  text-align: center;
  padding: 12px;
  border: 1px dashed var(--gold);
  border-radius: 10px;
  color: var(--wine);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.2s;
}
.upload-btn:hover { background: rgba(195, 154, 75, 0.1); }

#mediaNote {
  margin-top: 24px;
  font-weight: 600;
}

/* ---------- HERO PHOTO + THUMBNAILS ---------- */
.hero-photo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  background: var(--cream-2);
  margin: 16px 0 12px;
  border: 1px solid var(--line);
}
.hero-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-photo-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
  text-align: center;
  padding: 20px;
}
.hero-photo-empty[hidden] { display: none; }
.thumb-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  background: none;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.active { border-color: var(--wine); }
.thumb .remove-btn { width: 18px; height: 18px; font-size: 0.7rem; top: 2px; right: 2px; }

/* ---------- CLICK-TO-PLAY AUDIO/VIDEO CARD ---------- */
.mediacard {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--wood-2);
  margin: 16px 0;
}
.mediacard.audio-card {
  padding: 26px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
}
.mediacard.video-card { aspect-ratio: 16 / 10; }
.mediacard audio,
.mediacard video {
  width: 100%;
  display: block;
}
.mediacard.video-card video { height: 100%; object-fit: cover; }
.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(43, 33, 24, 0.35);
  border: none;
  cursor: pointer;
  padding: 0;
}
.play-overlay .play-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--wine);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}
.play-overlay:hover .play-icon { transform: scale(1.08); }

@media (max-width: 900px) {
  .media-columns { grid-template-columns: 1fr; }
}

/* ---------- LIKE BUTTON ---------- */
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--wine);
  background: #fff;
  color: var(--wine);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.like-btn:hover { background: rgba(124, 34, 51, 0.06); }
.like-btn.liked { background: var(--wine); color: #fff; }

.card-like-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(43, 33, 24, 0.72);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 22, 15, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
/* `display: flex` on the bare class would always win over the browser's
   default `[hidden] { display: none }` (author CSS beats UA CSS regardless
   of order), so the modal must only switch to flex when NOT hidden — this
   is what actually respects the hidden attribute the JS toggles. */
.modal-backdrop:not([hidden]) {
  display: flex;
}
.modal-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  max-width: 380px;
  width: 100%;
}
.modal-card h2 { font-size: 1.15rem; margin-bottom: 8px; }
.modal-card h2:empty { display: none; }

.ui-toast-host {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: 100%;
  padding: 0 16px;
}
.ui-toast {
  background: var(--wood-2, #3E1F0F);
  color: #fff;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: 90vw;
  text-align: center;
}
.ui-toast-show { opacity: 1; transform: translateY(0); }
.ui-toast-success { background: #2e6b3e; }
.ui-toast-error { background: var(--wine); }

/* ---------- SKELETON LOADING ---------- */
@keyframes ui-skeleton-pulse {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--cream-2) 25%, var(--cream, #f3ead9) 37%, var(--cream-2) 63%);
  background-size: 400px 100%;
  animation: ui-skeleton-pulse 1.4s ease-in-out infinite;
  border-radius: 8px;
}
.skeleton-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.skeleton-card .skeleton-photo { aspect-ratio: 3 / 4; border-radius: 0; }
.skeleton-card .skeleton-body { padding: 14px 16px; display: grid; gap: 8px; }
.skeleton-card .skeleton-line { height: 12px; }
.skeleton-card .skeleton-line.w-60 { width: 60%; }
.skeleton-card .skeleton-line.w-40 { width: 40%; }
.skeleton-row {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.skeleton-row .skeleton-avatar { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }
.skeleton-row .skeleton-lines { flex: 1; display: grid; gap: 8px; }
.skeleton-row .skeleton-line { height: 12px; }

/* ---------- MESSAGE FORM ---------- */
.message-form { margin-top: 22px; display: grid; gap: 10px; }
.message-form textarea {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  min-height: 90px;
  resize: vertical;
}

/* ---------- INBOX (profile.html) ---------- */
.inbox-section { margin-top: 44px; }
.inbox-section h2 { font-size: 1.3rem; margin-bottom: 4px; }
.inbox-tabs { display: flex; gap: 10px; margin-top: 18px; }
.inbox-tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.inbox-tab.active { border-color: var(--wine); color: var(--wine); background: rgba(124, 34, 51, 0.06); }
.inbox-list { display: grid; gap: 12px; margin-top: 18px; }
.inbox-list[hidden] { display: none; }
.inbox-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.inbox-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--cream-2);
  flex-shrink: 0;
}
.inbox-body { flex: 1; min-width: 0; }
.inbox-name { font-weight: 600; color: var(--wood-2); }
.inbox-text { margin-top: 4px; color: var(--ink); line-height: 1.5; overflow-wrap: break-word; }
.inbox-date { font-size: 0.78rem; color: var(--ink-soft); margin-top: 6px; }
.inbox-empty { color: var(--ink-soft); font-size: 0.9rem; }

.inline-reply-form { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.inline-reply-input {
  flex: 1;
  min-width: 160px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.88rem;
}
.inline-reply-note { flex-basis: 100%; font-size: 0.8rem; }

/* ---------- LOVUS WALLET ---------- */
.wallet-bar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px 8px 18px;
  box-shadow: var(--shadow);
  margin: 18px 0 6px;
}
.wallet-label { font-size: 0.85rem; color: var(--ink-soft); }
.wallet-balance { font-weight: 700; color: var(--wine); font-size: 1.1rem; }
.wallet-buy-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--wine);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.wallet-buy-btn:hover { background: var(--wine-2); }
.send-lovus-btn {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: #fff;
  color: var(--wine);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.send-lovus-btn:hover { background: rgba(195, 154, 75, 0.12); }

/* ---------- BADGES ---------- */
.notif-bell {
  font-size: 0.95rem;
  cursor: default;
}
.notif-bell:empty { display: none; }
.notif-bell.has-unread { color: var(--wine); font-weight: 700; }

.boost-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.boost-bar .btn { padding: 10px 20px; font-size: 0.88rem; }

.completeness-bar { margin-top: 18px; }
.completeness-track {
  height: 8px;
  border-radius: 999px;
  background: var(--cream);
  border: 1px solid var(--line);
  overflow: hidden;
}
.completeness-fill {
  height: 100%;
  width: 0%;
  background: var(--wine);
  transition: width 0.3s ease;
}
.completeness-bar .hint { display: block; margin-top: 6px; }

.onboarding-next {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(195, 154, 75, 0.12);
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 10px 14px;
}
.onboarding-next span { font-weight: 600; font-size: 0.9rem; color: var(--wood-2); }
.onboarding-next .btn { padding: 6px 14px; font-size: 0.82rem; white-space: nowrap; }

.wallet-list { display: grid; gap: 14px; margin-top: 16px; }
.wallet-input-row { display: flex; gap: 8px; }
.wallet-input-row input { flex: 1; min-width: 0; }

@media (max-width: 480px) {
  .wallet-input-row { flex-wrap: wrap; }
  .wallet-input-row input { flex-basis: 100%; }
  .wallet-input-row .btn { flex: 1; }
  .onboarding-next { flex-direction: column; align-items: stretch; text-align: center; }
}

.feature-prefs-section {
  margin-top: 28px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.feature-prefs-section h2 { font-size: 1.05rem; margin-bottom: 4px; }

.feature-prefs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 14px;
}
.feature-pref-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  cursor: pointer;
}

.badges-section {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.badges-section h2 { font-size: 1.2rem; margin-bottom: 6px; }

.verification-section {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.verification-section h2 { font-size: 1.1rem; margin-bottom: 6px; }

.badge-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.badge-chip {
  --badge-color: #c39a4b;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--badge-color);
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: var(--shadow);
}
.badge-chip.hidden-badge { opacity: 0.55; }
.badge-chip.featured { background: linear-gradient(90deg, rgba(195, 154, 75, 0.08), transparent); }

.badge-inline-list { display: inline-flex; flex-wrap: wrap; gap: 8px; vertical-align: middle; }
.badge-chip.mini {
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  gap: 6px;
  font-size: 0.8rem;
  box-shadow: none;
}
.badge-chip.mini .badge-icon { width: 22px; height: 22px; font-size: 0.9rem; }

.badge-icon {
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--badge-color) 16%, white);
  flex-shrink: 0;
}

.badge-info { display: grid; gap: 2px; flex: 1; min-width: 0; }
.badge-name { font-weight: 700; color: var(--wood-2); }
.badge-desc { font-size: 0.85rem; color: var(--ink-soft); }

.badge-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.badge-toggle {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
}
.badge-toggle:hover { border-color: var(--wine); color: var(--wine); }

@media (max-width: 560px) {
  .badge-chip { flex-wrap: wrap; }
  .badge-actions { width: 100%; }
}
