/* ============================================
   EnklareFlytt — Custom Styles
   Beyond Tailwind CSS
   ============================================ */

/* ---------- Prevent horizontal scroll ---------- */

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* ---------- Animations ---------- */

@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-1rem);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(1.5rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.animate-slide-down {
    animation: slide-down 0.4s ease-out;
}

.animate-slide-up {
    animation: slide-up 0.5s ease-out;
}

.animate-fade-in {
    animation: fade-in 0.5s ease-out;
}

.animate-scale-in {
    animation: scale-in 0.4s ease-out;
}

.animate-pulse-soft {
    animation: pulse-soft 2s ease-in-out infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Stagger animation delays for children */
.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 80ms; }
.stagger-children > *:nth-child(3) { animation-delay: 160ms; }
.stagger-children > *:nth-child(4) { animation-delay: 240ms; }
.stagger-children > *:nth-child(5) { animation-delay: 320ms; }
.stagger-children > *:nth-child(6) { animation-delay: 400ms; }
.stagger-children > *:nth-child(7) { animation-delay: 480ms; }
.stagger-children > *:nth-child(8) { animation-delay: 560ms; }
.stagger-children > *:nth-child(9) { animation-delay: 640ms; }
.stagger-children > *:nth-child(10) { animation-delay: 720ms; }

/* ---------- Custom Scrollbar ---------- */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 transparent;
}

.dark * {
    scrollbar-color: #475569 transparent;
}

/* ---------- Smooth transitions ---------- */

a, button, input, textarea, select {
    transition-property: color, background-color, border-color, box-shadow, opacity, transform;
    transition-duration: 200ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Focus styles ---------- */

*:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- FAQ Accordion ---------- */

.faq-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease-out;
}

.faq-content.open {
    max-height: 600px;
    opacity: 1;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease-in 0.1s;
}

/* Plus → × rotation when item is open */
.faq-item.is-open .faq-icon {
    background-color: rgb(22 163 74); /* accent-600 */
    color: #fff;
    transform: rotate(45deg);
}

.faq-icon {
    transition: transform 0.3s ease, background-color 0.2s ease, color 0.2s ease;
}

/* Subtle highlight on open card */
.faq-item.is-open {
    border-color: rgb(134 239 172); /* accent-300 */
    box-shadow: 0 4px 16px -4px rgba(22, 163, 74, 0.15);
}

/* Legacy fallback for old chevron (in case it's still referenced elsewhere) */
.faq-chevron {
    transition: transform 0.3s ease;
}
.faq-chevron.open {
    transform: rotate(180deg);
}

/* ---------- Hero gradient overlay ---------- */

.hero-gradient {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
}

.dark .hero-gradient {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1e40af 100%);
}

/* ---------- Glass effect for cards ---------- */

.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.dark .glass {
    background: rgba(15, 23, 42, 0.8);
}

/* ---------- Gradient text ---------- */

.gradient-text {
    background: linear-gradient(135deg, #2563eb 0%, #16a34a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---------- Selection color ---------- */

::selection {
    background-color: #2563eb;
    color: white;
}

/* ---------- Form input styles ---------- */

.form-input {
    width: 100%;
    padding: 0.625rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid #d1d5db;
    background: white;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

.dark .form-input {
    background: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}

.dark .form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-input.error {
    border-color: #ef4444;
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* ---------- Elevator toggle ---------- */

.elevator-toggle input:checked ~ div .elevator-icon {
    color: currentColor;
}

.elevator-toggle input:checked ~ div .elevator-text {
    color: #111827;
    font-weight: 600;
}

.dark .elevator-toggle input:checked ~ div .elevator-text {
    color: #f1f5f9;
}

.elevator-toggle input:checked ~ div .elevator-switch {
    background-color: #22c55e;
}

.elevator-toggle input:checked ~ div .elevator-switch .elevator-knob {
    transform: translateX(16px);
}

/* ---------- Loading shimmer ---------- */

.shimmer {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.dark .shimmer {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------- Step connector line ---------- */

.step-line {
    position: absolute;
    top: 1.5rem;
    left: calc(50% + 2rem);
    right: calc(-50% + 2rem);
    height: 2px;
    background: #d1d5db;
}

.dark .step-line {
    background: #475569;
}
