/* ==========================================================================
   MEMORIA AETERNA - QUIET GOTHIC & NOTRE-DAME DESIGN SYSTEM
   ========================================================================== */

:root {
  --color-surface: #141518;
  --color-surface-dim: #101114;
  --color-surface-container: #1D1F24;
  --color-surface-container-high: #24272E;
  --color-surface-container-highest: #2E313A;
  --color-surface-container-lowest: #0B0C0E;
  
  --color-gold-primary: #C5A059;
  --color-gold-light: #DFBA73;
  --color-gold-dark: #8A6E38;
  --color-gold-glow: rgba(197, 160, 89, 0.18);
  
  --color-parchment: #EAE6DF;
  --color-parchment-muted: #BDB8AD;
  --color-ash: #9CA3AF;
  
  --border-gold-subtle: rgba(138, 110, 56, 0.35);
  --border-gold-focus: #C5A059;
}

/* Custom Scrollbar - Subdued Antique Bronze */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--color-surface);
}
::-webkit-scrollbar-thumb {
  background: var(--color-gold-dark);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-gold-primary);
}

/* Base resets & typography */
body {
  background-color: var(--color-surface);
  color: var(--color-parchment);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, .font-serif-gothic {
  font-family: 'EB Garamond', 'Cormorant Garamond', serif;
  letter-spacing: -0.01em;
}

.font-cinzel {
  font-family: 'Cinzel', serif;
}

/* Gothic Lancet Arches */
.lancet-arch-top {
  border-top-left-radius: 2.5rem;
  border-top-right-radius: 2.5rem;
}

.lancet-arch-card {
  border-top-left-radius: 1.75rem;
  border-top-right-radius: 1.75rem;
  border-bottom-left-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}

/* Gold Hairlines & Masonry Borders */
.gold-border-subtle {
  border: 1px solid var(--border-gold-subtle);
}

.gold-border-subtle:hover,
.gold-border-subtle:focus-within {
  border-color: var(--color-gold-primary);
}

.gold-border-active {
  border: 1px solid var(--color-gold-primary);
  box-shadow: 0 0 16px rgba(197, 160, 89, 0.12);
}

/* Gothic Divider with Lozenge Diamond */
.gothic-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  margin: 1.5rem 0;
}

.gothic-divider::before,
.gothic-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--border-gold-subtle), transparent);
}

.gothic-divider-diamond {
  color: var(--color-gold-primary);
  font-size: 11px;
  opacity: 0.85;
}

/* Interactive Before / After Slider */
.ba-slider-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  user-select: none;
  border-radius: 0.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  background-color: var(--color-surface-container-lowest);
}

.ba-slider-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ba-slider-before {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  overflow: hidden;
  z-index: 10;
}

.ba-slider-before .ba-slider-img {
  max-width: none;
}

.ba-slider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: var(--color-gold-primary);
  box-shadow: 0 0 12px rgba(197, 160, 89, 0.8);
  cursor: ew-resize;
  z-index: 20;
}

.ba-slider-handle-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: var(--color-surface-container-high);
  border: 1px solid var(--color-gold-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gold-primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  transition: transform 0.15s ease, background 0.15s ease;
}

.ba-slider-handle-button:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background: var(--color-gold-primary);
  color: #141518;
}

/* Calligraphic Ribbon Preview */
.calligraphic-ribbon {
  position: relative;
  min-height: 84px;
  padding: 1.25rem 2.5rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
  overflow: hidden;
}

.calligraphic-ribbon::before,
.calligraphic-ribbon::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 14px;
  background: inherit;
  filter: brightness(0.85);
}

.calligraphic-ribbon::before {
  left: -7px;
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
}

.calligraphic-ribbon::after {
  right: -7px;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.ribbon-green {
  background: linear-gradient(135deg, #1b382b, #0f231b, #1b382b);
  border: 1px solid #2e5543;
}

.ribbon-black {
  background: linear-gradient(135deg, #1a1a1e, #0d0d10, #1a1a1e);
  border: 1px solid #33343c;
}

.ribbon-gold {
  background: linear-gradient(135deg, #443419, #2b200d, #443419);
  border: 1px solid #755b2d;
}

.ribbon-burgundy {
  background: linear-gradient(135deg, #421820, #260c12, #421820);
  border: 1px solid #6b2633;
}

.ribbon-white {
  background: linear-gradient(135deg, #ded8cd, #c5beb1, #ded8cd);
  border: 1px solid #a89f8f;
}

.ribbon-text-gold {
  color: #f7df99;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 6px rgba(247, 223, 153, 0.4);
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
}

.ribbon-text-silver {
  color: #e4e7eb;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 6px rgba(228, 231, 235, 0.4);
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.gothic-toast {
  pointer-events: auto;
  background: #1D1F24;
  border: 1px solid var(--color-gold-primary);
  color: var(--color-parchment);
  padding: 0.85rem 1.25rem;
  border-radius: 4px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 400px;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Animations & Transitions */
.view-transition {
  animation: fadeInView 0.35s ease-out;
}

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

/* Interactive Calendar Cells */
.calendar-day-btn {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 0.85rem;
  transition: all 0.15s ease;
  position: relative;
}

.calendar-day-btn:hover:not(:disabled) {
  background-color: var(--color-surface-container-highest);
  color: var(--color-gold-primary);
}

.calendar-day-btn.selected {
  background-color: var(--color-gold-primary) !important;
  color: #141518 !important;
  font-weight: 700;
}

.calendar-day-btn.has-slots::after {
  content: "";
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--color-gold-primary);
}

.calendar-day-btn.selected.has-slots::after {
  background-color: #141518;
}

/* Print Styles for Conservation Certificate */
@media print {
  body * {
    visibility: hidden;
  }
  #certificate-print-area, #certificate-print-area * {
    visibility: visible;
  }
  #certificate-print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
}
