/* Custom CSS for Leasing Calculator (Tailwind based - Twilight Theme) */

body {
  font-family: "Outfit", sans-serif;
  transition:
    background-color 0.2s,
    color 0.2s;
}

.custom-shadow {
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

.material-symbols-outlined {
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
}

/* Range Slider Styling - Ujednolicone z projektem OC */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #e2e8f0;
  border-radius: 5px;
  background-image: linear-gradient(#10b981, #10b981); /* Emerald-500 */
  background-repeat: no-repeat;
  cursor: pointer;
}

.dark input[type="range"] {
  background: #334155;
}

/* Footer & Clause Animation */
.footer-content {
  transition:
    max-height 0.4s ease,
    opacity 0.4s ease;
  overflow: hidden;
  opacity: 0;
  max-height: 0;
}

.footer-content.open {
  opacity: 1;
  max-height: 2000px;
}

.footer-toggle {
  cursor: pointer;
  user-select: none;
}

/* Validation Classes */
input.cf-invalid,
select.cf-invalid {
  border-color: #dc2626 !important; /* text-red-600 */
  box-shadow: 0 0 0 1px #dc2626 !important;
}

input.cf-valid,
select.cf-valid {
  border-color: #10b981 !important; /* text-emerald-500 */
  box-shadow: 0 0 0 1px #10b981 !important;
}

.cf-error {
  display: none;
  font-size: 11px;
  color: #dc2626;
  margin-top: 4px;
}

.cf-error.active {
  display: block;
}

/* Custom Scrollbar for Dropdowns */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 20px;
}
.dark .custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: #475569;
}

/* Utils */
.text-primary {
  color: #10b981;
}
.bg-primary {
  background: #10b981;
}

/* Car Logos Grid Optimization */
/* Car Logos Grid Optimization */
.brand-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  aspect-ratio: 1 / 1;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border-radius: 12px;
  background: transparent;
}

@media (min-width: 768px) {
  .brand-item {
    width: 112px;
    height: 112px;
  }
}

.brand-item img {
  max-width: 65%;
  max-height: 65%;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.4;
  transition: all 0.3s ease;
}

.brand-item.active {
  background: #f1f5f9; /* slate-100 */
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transform: scale(1.1);
}

.brand-item.active img,
.brand-item:hover img {
  filter: grayscale(0%);
  opacity: 1;
}

.dark .brand-item.active {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.brand-item:hover {
  transform: scale(1.05);
}

.dark .brand-item img {
  filter: grayscale(100%) invert(1);
  opacity: 0.5;
}

.dark .brand-item:hover img {
  filter: grayscale(0%) invert(1);
  opacity: 0.8;
}

/* Range Sliders Fix */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 24px; /* Matches h-6 in PHP */
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0;
  margin: 0;
  cursor: pointer;
  outline: none;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px; /* Matches h-1 track */
  background: transparent;
}

input[type="range"]::-moz-range-track {
  width: 100%;
  height: 4px;
  background: transparent;
}

/* Thumb (Kropka) Stylizacja */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: #10b981; /* primary emerald */
  cursor: pointer;
  margin-top: -8px; /* (20 - 4) / 2 = 8. Centruje kropkę względem paska 4px */
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: transform 0.1s ease;
}

.dark input[type="range"]::-webkit-slider-thumb {
  border-color: #1e293b; /* Dopasowanie do ciemniejszego tła karty */
}

input[type="range"]::-moz-range-thumb {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: #10b981;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.15);
}

/* Hide arrows in number inputs */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* --- Cookies Banner --- */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #1e293b; /* Slate-800 */
  color: #fff;
  padding: 15px 20px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#cookie-banner.hide {
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
}

#cookie-banner .cookie-content {
  max-width: 900px;
  display: flex;
  align-items: center;
  gap: 20px;
}

#cookie-banner p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #cbd5e1;
}

#cookie-banner button {
  background: #10b981; /* Emerald-500 */
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

#cookie-banner button:hover {
  background: #059669; /* Emerald-600 */
}

@media (max-width: 600px) {
  #cookie-banner .cookie-content {
    flex-direction: column;
    text-align: center;
  }
  #cookie-banner button {
    width: 100%;
  }
}
