/* Custom properties for BREGA-SPA Design System */
:root {
  --color-primary: #8B7355;
  --color-accent: #C4A882;
  --color-dark: #2D2318;
  --color-bg: #EDE6DA;
  --color-card: #F3EDE3;
  --color-success: #10B981;
  --color-error: #EF4444;
}

/* Base Styles */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-tap-highlight-color: transparent;
  background-color: var(--color-bg);
}

/* Matte paper instead of bright white — easier at night */
.bg-white,
.bg-white\/90,
.bg-white\/80,
.bg-white\/70,
.bg-white\/50 {
  background-color: #F3EDE3 !important;
}
.bg-\[\#F9F5F0\],
.bg-bg {
  background-color: #EDE6DA !important;
}
.toast,
.spa-input {
  background-color: #F3EDE3;
}

/* Hide scrollbar for carousels */
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}
.hide-scrollbar {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

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

.pw-toggle { color: #A08B72; }
.hero-frame {
  box-shadow: 0 18px 40px rgba(45, 35, 24, 0.12);
}
.hero-photo {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(54vh, 560px);
  object-fit: contain;
  object-position: center;
}
@media (min-width: 1024px) {
  .hero-photo {
    max-height: min(70vh, 680px);
  }
}
.karen-photo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
}
.home-video-frame {
  overflow: hidden;
}
.home-video-frame video,
.home-video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #E8DFD2;
}
.media-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #E8DFD2;
}
.media-frame--card {
  aspect-ratio: 4 / 3;
}
.media-frame--thumb {
  width: 5rem;
  height: 5rem;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
}
.media-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input::-ms-reveal,
input::-ms-clear {
  display: none !important;
  width: 0;
  height: 0;
}
input[type="password"]::-webkit-credentials-auto-fill-button,
input[type="password"]::-webkit-strong-password-auto-fill-button {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
  position: absolute;
  right: 0;
  width: 0;
  height: 0;
}

#testimonial-container {
  cursor: grab;
  -webkit-overflow-scrolling: touch;
}
#testimonial-container.active {
  cursor: grabbing;
  scroll-behavior: auto;
}
.testimonial-card {
  flex: 0 0 auto;
}

@media (prefers-reduced-motion: reduce) {
  .animate-fade-in-up {
    animation: none;
  }
}

.fade-in-section {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.is-visible {
  opacity: 1;
  transform: none;
}

/* Bottom Nav Safe Area Support */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .pb-safe {
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
  }
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

@media (min-width: 768px) {
  #toast-container {
    bottom: 2rem;
    right: 2rem;
    left: auto;
    transform: none;
  }
}

.toast {
  background: white;
  color: var(--color-dark);
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  pointer-events: auto;
  transition: all 0.3s ease;
  animation: slideInUp 0.3s ease-out forwards;
  border-left: 4px solid var(--color-primary);
}

.toast.success { border-left-color: var(--color-success); }
.toast.error { border-left-color: var(--color-error); }

.toast.hide {
  opacity: 0;
  transform: translateY(100%);
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}

/* Forms */
.spa-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background-color: white;
  transition: all 0.2s;
  font-family: inherit;
}

.spa-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.1);
}

.spa-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-dark);
  margin-bottom: 0.5rem;
}

/* Spinner */
.spinner {
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top: 3px solid white;
  width: 20px;
  height: 20px;
  -webkit-animation: spin 1s linear infinite; /* Safari */
  animation: spin 1s linear infinite;
}

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