/* ========================================
   ONYX & AMBER — Volcanic Luxury Gallery
   ======================================== */

:root {
  --bg: #0b0a08;
  --bg-elevated: #13110e;
  --surface: #1a1812;
  --surface-hover: #221f18;
  --border: #2a2620;
  --border-warm: #3d3528;
  --text: #e8e2d6;
  --text-dim: #b5ae9f;
  --text-muted: #736d60;
  --accent: #e4a853;
  --accent-deep: #c4842a;
  --accent-glow: rgba(228, 168, 83, 0.12);
  --accent-glow-strong: rgba(228, 168, 83, 0.25);
  --danger: #c95a4e;
  --radius: 4px;
  --radius-lg: 8px;
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Karla', system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ---- Download Prevention ---- */
img, video {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}
.masonry-item, .video-item, .lb-content {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
/* Re-enable pointer events where needed */
.lb-content video.active {
  pointer-events: auto;
}
/* Hide native video download button */
video::-webkit-media-controls-enclosure {
  overflow: hidden;
}
video::-webkit-media-controls-panel {
  width: calc(100% + 30px);
}
video::-internal-media-controls-download-button {
  display: none !important;
}
video::-webkit-media-controls-download-button {
  display: none !important;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
}

/* ---- Film Grain Overlay ---- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ---- Logo ---- */
.logo,
.site-logo {
  display: block;
  width: 100%;
  height: auto;
}

/* ---- Header ---- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px 24px 6px;
  animation: fadeDown 0.8s var(--ease-out) both;
}

.site-logo {
  width: 140px;
}

.header-line {
  flex: 1;
  max-width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-warm), transparent);
}

/* ---- Tabs ---- */
.tabs {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 14px 16px 0;
  background: linear-gradient(to bottom, var(--bg) 60%, transparent);
  animation: fadeDown 0.8s var(--ease-out) 0.1s both;
}

.tab {
  position: relative;
  padding: 8px 4px 12px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.3s;
  -webkit-tap-highlight-color: transparent;
}

.tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 0.4s var(--ease-out), left 0.4s var(--ease-out);
}

.tab:hover {
  color: var(--text-dim);
}

.tab.active {
  color: var(--accent);
}

.tab.active::after {
  width: 100%;
  left: 0;
}

.tab-count {
  font-size: 0.65rem;
  opacity: 0.5;
  margin-left: 2px;
}

/* ---- Masonry Grid ---- */
.masonry {
  column-count: 2;
  column-gap: 5px;
  padding: 16px 5px 5px;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 5px;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--surface);
  transform: translateY(20px);
  opacity: 1;
  animation: revealItem 0.6s var(--ease-out) both;
}

.masonry-item:nth-child(4n+1) { animation-delay: 0s; }
.masonry-item:nth-child(4n+2) { animation-delay: 0.06s; }
.masonry-item:nth-child(4n+3) { animation-delay: 0.12s; }
.masonry-item:nth-child(4n+4) { animation-delay: 0.18s; }

.masonry-item img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 1;
  transition: opacity 0.6s var(--ease-out), transform 0.4s var(--ease-out);
}

.masonry-item img.loaded {
  opacity: 1;
}

.item-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent 40%,
    rgba(228, 168, 83, 0.06) 50%,
    transparent 60%
  );
  opacity: 1;
  transition: opacity 0.4s;
  pointer-events: none;
}

/* ---- Video Grid ---- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  padding: 16px 5px 5px;
}

.video-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
  aspect-ratio: 9 / 16;
  transform: translateY(20px);
  opacity: 1;
  animation: revealItem 0.6s var(--ease-out) both;
}

.video-item:nth-child(3n+1) { animation-delay: 0s; }
.video-item:nth-child(3n+2) { animation-delay: 0.08s; }
.video-item:nth-child(3n+3) { animation-delay: 0.16s; }

.video-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 50%);
  transition: background 0.3s;
}

.play-overlay svg {
  width: 48px;
  height: 48px;
  color: rgba(255, 255, 255, 0.8);
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.6));
  transition: transform 0.3s var(--ease-spring), opacity 0.3s;
}

.video-item:hover .play-overlay svg {
  transform: scale(1.12);
}

/* ---- Video Lock (web-only) ---- */
.video-locked {
  cursor: default;
  pointer-events: none;
}

.video-lock {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--surface);
}

.lock-icon {
  width: 36px;
  height: 36px;
  color: var(--text-muted);
}

.lock-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-align: center;
  padding: 0 12px;
}

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.35s var(--ease-out);
}

.lightbox.hidden {
  opacity: 1;
  pointer-events: none;
}

.lightbox.hidden .lb-content img,
.lightbox.hidden .lb-content video {
  transform: scale(0.92);
}

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 5, 4, 0.94);
  backdrop-filter: blur(32px) saturate(0.5);
  -webkit-backdrop-filter: blur(32px) saturate(0.5);
}

.lb-content {
  position: relative;
  z-index: 1;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-content img,
.lb-content video {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 2px;
  display: none;
  transition: transform 0.4s var(--ease-out);
  transform: scale(1);
}

.lb-content img.active,
.lb-content video.active {
  display: block;
}

.lb-close,
.lb-prev,
.lb-next {
  position: absolute;
  z-index: 2;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: color 0.25s, transform 0.25s var(--ease-spring);
  -webkit-tap-highlight-color: transparent;
  padding: 12px;
}

.lb-close svg,
.lb-prev svg,
.lb-next svg {
  width: 24px;
  height: 24px;
}

.lb-close:hover,
.lb-prev:hover,
.lb-next:hover {
  color: var(--accent);
}

.lb-close {
  top: 12px;
  right: 12px;
}

.lb-prev,
.lb-next {
  top: 50%;
  transform: translateY(-50%);
}

.lb-prev { left: 4px; }
.lb-next { right: 4px; }

.lb-prev:hover { transform: translateY(-50%) translateX(-3px); }
.lb-next:hover { transform: translateY(-50%) translateX(3px); }

.lb-counter {
  position: absolute;
  z-index: 2;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  background: rgba(11, 10, 8, 0.6);
  padding: 4px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
}

/* ---- Utility ---- */
.hidden {
  display: none !important;
}

/* ---- Responsive ---- */
@media (min-width: 640px) {
  .subjects-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 16px 10px 10px;
  }
  .subject-card { border-radius: var(--radius-lg); }

  .masonry {
    column-count: 3;
    column-gap: 8px;
    padding: 16px 8px 8px;
  }
  .masonry-item {
    margin-bottom: 8px;
    border-radius: var(--radius-lg);
  }

  .video-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 16px 8px 8px;
  }
  .video-item { border-radius: var(--radius-lg); }
}

@media (min-width: 1024px) {
  .subjects-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 20px 24px 12px;
  }
  .subject-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-warm);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 24px rgba(228, 168, 83, 0.08);
  }
  .subject-card:hover img {
    transform: scale(1.04);
  }

  .site-header { padding: 28px 32px 8px; }
  .site-logo { width: 180px; }
  .header-line { max-width: 100px; }

  .masonry {
    column-count: 4;
    column-gap: 10px;
    padding: 20px 24px 10px;
  }
  .masonry-item {
    margin-bottom: 10px;
  }
  .masonry-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border);
  }
  .masonry-item:hover .item-shine {
    opacity: 1;
  }
  .masonry-item:hover img.loaded {
    transform: scale(1.015);
  }

  .video-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 20px 24px 10px;
  }

  .play-overlay svg { width: 56px; height: 56px; }

  .lb-close svg,
  .lb-prev svg,
  .lb-next svg {
    width: 28px;
    height: 28px;
  }
  .lb-prev { left: 20px; }
  .lb-next { right: 20px; }
}

@media (min-width: 1440px) {
  .masonry {
    column-count: 5;
    column-gap: 12px;
    padding: 20px 40px 12px;
  }
  .masonry-item { margin-bottom: 12px; }

  .video-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 20px 40px 12px;
  }
}

@media (hover: none) {
  .masonry-item:hover {
    transform: none;
    box-shadow: none;
  }
  .masonry-item:hover .item-shine { opacity: 1; }
  .masonry-item:hover img.loaded { transform: none; }
}

/* ---- Login / Register ---- */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  padding: 40px 28px 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  animation: fadeUp 0.7s var(--ease-out) both;
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo .logo {
  width: 180px;
  margin: 0 auto;
}

.login-ornament {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-warm), transparent);
  margin: 0 10px 24px;
}

.login-subtitle {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 20px;
}

.login-error {
  background: rgba(201, 90, 78, 0.1);
  border-left: 2px solid var(--danger);
  color: #e8a099;
  font-size: 0.82rem;
  padding: 10px 14px;
  margin-bottom: 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.input-group {
  position: relative;
  margin-bottom: 16px;
}

.login-input {
  display: block;
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.login-input:focus {
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-input::placeholder {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Override browser autofill white background */
.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  border-color: var(--border);
  transition: background-color 5000s ease-in-out 0s;
}

.input-label {
  display: none;
}

.login-btn {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: 20px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-lg);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}

.login-btn:hover {
  background: var(--accent-deep);
  box-shadow: 0 4px 20px var(--accent-glow-strong);
}

.login-btn:active {
  transform: scale(0.98);
}

.login-link {
  text-align: center;
  margin-top: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.login-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.login-link a:hover {
  text-decoration: underline;
}

/* ---- Logout ---- */
.logout-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 60;
  padding: 5px 14px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s;
  text-decoration: none;
}

.logout-btn:hover {
  color: var(--accent);
  border-color: var(--accent-deep);
}

/* ---- App Download Banner ---- */
.app-banner {
  position: sticky;
  top: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: var(--accent);
  animation: fadeDown 0.5s var(--ease-out) both;
}

.app-banner-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-align: center;
}

.app-banner-link:hover {
  text-decoration: underline;
}


/* ---- Home Atmosphere ---- */

.home-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 50% 8%, rgba(196, 132, 42, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 90% 40% at 50% 100%, rgba(228, 168, 83, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 50% 80% at 20% 50%, rgba(196, 132, 42, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse 50% 80% at 80% 50%, rgba(196, 132, 42, 0.03) 0%, transparent 50%);
}

.home-atmosphere::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(228, 168, 83, 0.15), transparent);
}

.home-header {
  padding-top: 32px;
  position: relative;
  z-index: 1;
}

.home-tagline {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  padding: 2px 0 0;
  opacity: 1;
  animation: fadeUp 1s var(--ease-out) 0.3s both;
}

.home-ornament {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 40px;
  opacity: 1;
  animation: fadeUp 1s var(--ease-out) 0.5s both;
}

.ornament-line {
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-warm), transparent);
}

.ornament-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border-warm);
}

.ornament-diamond {
  width: 6px;
  height: 6px;
  background: var(--accent-deep);
  transform: rotate(45deg);
  opacity: 0.6;
}

/* ---- Search Bar ---- */
.search-bar {
  position: sticky;
  top: 0;
  z-index: 51;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 8px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  opacity: 1;
  animation: fadeUp 0.6s var(--ease-out) 0.6s both;
}

.search-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.search-input {
  flex: 1;
  border: none;
  background: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.search-clear:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.search-count {
  flex-shrink: 0;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* ---- Scroll Sentinel & Loading ---- */
.scroll-sentinel {
  height: 1px;
}

.loading-spinner {
  display: flex;
  justify-content: center;
  padding: 24px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 60px 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

/* ---- Subject Cards ---- */
.subjects-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 16px 8px 80px;
}

.subject-card {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  transform: translateY(20px);
  opacity: 1;
  animation: revealItem 0.6s var(--ease-out) both;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), border-color 0.4s;
}

.subject-card:nth-child(2) { animation-delay: 0.08s; }
.subject-card:nth-child(3) { animation-delay: 0.16s; }
.subject-card:nth-child(4) { animation-delay: 0.24s; }

.subject-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease-out);
}

.subject-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 16px 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
  pointer-events: none;
}

.subject-card-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.subject-card-counts {
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

/* ---- Subject Title ---- */
.subject-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-align: center;
  color: var(--text-dim);
  padding: 4px 0 0;
  animation: fadeDown 0.8s var(--ease-out) 0.05s both;
}

/* ---- Back Link ---- */
.back-link {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s;
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent);
  border-color: var(--accent-deep);
}

.back-link svg {
  flex-shrink: 0;
}

/* ---- Request Content FAB ---- */

@keyframes fab-glow {
  0%   { box-shadow:
           0 0 0 0 rgba(228, 168, 83, 0.4),
           0 0 0 0 rgba(228, 168, 83, 0.15),
           0 4px 30px rgba(228, 168, 83, 0.3),
           0 2px 10px rgba(0, 0, 0, 0.5);
  }
  50%  { box-shadow:
           0 0 0 8px rgba(228, 168, 83, 0),
           0 0 0 20px rgba(228, 168, 83, 0),
           0 4px 40px rgba(228, 168, 83, 0.4),
           0 2px 10px rgba(0, 0, 0, 0.5);
  }
  100% { box-shadow:
           0 0 0 0 rgba(228, 168, 83, 0.4),
           0 0 0 0 rgba(228, 168, 83, 0.15),
           0 4px 30px rgba(228, 168, 83, 0.3),
           0 2px 10px rgba(0, 0, 0, 0.5);
  }
}

@keyframes fab-icon-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.request-fab {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 36px;
  border-radius: 100px;
  border: 1px solid var(--accent-deep);
  background: rgba(19, 17, 14, 0.85);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  color: var(--accent);
  cursor: pointer;
  box-shadow:
    0 0 0 0 rgba(228, 168, 83, 0.4),
    0 0 0 0 rgba(228, 168, 83, 0.15),
    0 4px 30px rgba(228, 168, 83, 0.3),
    0 2px 10px rgba(0, 0, 0, 0.5);
  animation: fab-glow 2.4s ease-in-out 1s infinite;
  transition: transform 0.25s var(--ease-spring), border-color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.fab-icon {
  flex-shrink: 0;
  animation: fab-icon-spin 8s linear infinite;
}

.fab-label {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.request-fab:hover {
  transform: translateX(-50%) scale(1.04);
  border-color: var(--accent);
  background: rgba(19, 17, 14, 0.95);
  animation: none;
  box-shadow:
    0 0 0 1px var(--accent-deep),
    0 0 30px rgba(228, 168, 83, 0.3),
    0 4px 40px rgba(228, 168, 83, 0.4),
    0 2px 10px rgba(0, 0, 0, 0.5);
}

.request-fab:active {
  transform: translateX(-50%) scale(0.97);
}

/* ---- Request Content Modal ---- */

/* Overlay matches lightbox pattern exactly — consistent z-axis language */
.request-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 1;
  transition: opacity 0.3s var(--ease-out);
}

/* Visibility toggle via opacity/pointer-events — allows CSS transition on open */
.request-modal.hidden {
  opacity: 1;
  pointer-events: none;
}

.request-modal.hidden .request-card {
  transform: translateY(20px) scale(0.97);
}

.request-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 5, 4, 0.88);
  backdrop-filter: blur(20px) saturate(0.6);
  -webkit-backdrop-filter: blur(20px) saturate(0.6);
}

/* Card mirrors .login-card structure — same elevated dark surface with warm border */
.request-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  padding: 36px 28px 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-warm);
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border);
  transform: translateY(0) scale(1);
  transition: transform 0.35s var(--ease-spring);
  max-height: 90dvh;
  overflow-y: auto;
  /* Subtle scrollbar matching dark theme */
  scrollbar-width: thin;
  scrollbar-color: var(--border-warm) transparent;
}

.request-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.request-close:hover {
  color: var(--text);
  background: var(--surface-hover);
}

/* Display font title — Cormorant Garamond for luxury register */
.request-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--text);
  text-align: center;
  margin-bottom: 10px;
}

/* Warm separator — same ornament pattern as login */
.request-ornament {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-warm), transparent);
  margin: 0 10px 20px;
}

/* Labels — visible above inputs to reduce cognitive load (no floating label ambiguity) */
.request-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.request-optional {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--text-muted);
  opacity: 0.65;
}

/* Select: dark theme with custom amber chevron — browser default arrows break aesthetic */
.request-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 7L11 1' stroke='%23736d60' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.request-select:focus {
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Select options — dark surface, warm text */
.request-select option {
  background: var(--bg-elevated);
  color: var(--text);
}

/* Textarea inherits login-input, extends height */
.request-textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.55;
}

/* Submit button: reuses .login-btn but with margin override */
.request-btn {
  margin-top: 16px;
}

/* Success state — muted green, non-intrusive, confirms action without blaring */
.request-success {
  background: rgba(74, 161, 106, 0.1);
  border-left: 2px solid #4aa16a;
  color: #8ecfa8;
  font-size: 0.82rem;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Error state — mirrors .login-error exactly */
.request-error {
  background: rgba(201, 90, 78, 0.1);
  border-left: 2px solid var(--danger);
  color: #e8a099;
  font-size: 0.82rem;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Mobile: near full-width card with safe insets */
@media (max-width: 480px) {
  .request-card {
    padding: 32px 20px 24px;
  }
  .request-fab {
    bottom: 16px;
    left: 16px;
    right: 16px;
    width: auto;
    transform: none;
    padding: 16px 24px;
  }
  .request-fab:hover {
    transform: scale(1.02);
  }
  .request-fab:active {
    transform: scale(0.97);
  }
}

/* ---- Animations ---- */
@keyframes revealItem {
  from {
    opacity: 1;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeDown {
  from {
    opacity: 1;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 1;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
