/* SamenHypotheek v3.0 - Glassmorphism & Light Theme */

/* ==========================================
   BASE STYLES
========================================== */
html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0f9ff 100%);
    min-height: 100vh;
}

/* ==========================================
   GLASSMORPHISM COMPONENTS
========================================== */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(14, 165, 233, 0.08);
}

.glass-input {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(14, 165, 233, 0.2);
    transition: all 0.3s ease;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.9);
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
    outline: none;
}

/* ==========================================
   ANIMATIONS
========================================== */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Premium Dropdown Utilities */
.max-h-0 {
    max-height: 0;
}

.overflow-hidden {
    overflow: hidden;
}

.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.duration-500 {
    transition-duration: 500ms;
}

.ease-in-out {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-soft {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4);
    }

    50% {
        box-shadow: 0 0 0 12px rgba(249, 115, 22, 0);
    }
}

@keyframes pulse-warm {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(249, 115, 22, 0.3);
    }

    50% {
        box-shadow: 0 4px 30px rgba(249, 115, 22, 0.5);
    }
}


@keyframes grow-bar {
    from {
        width: 0;
    }

    to {
        width: var(--bar-width);
    }
}

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

.fade-up {
    animation: fade-up 0.5s ease-out forwards;
}

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

.power-bar {
    animation: grow-bar 1s ease-out forwards;
}

/* ==========================================
   SCROLL-AWARE HEADER (Conversion Optimization)
========================================== */
header {
    transition: all 0.3s ease;
}

header.scrolled {
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.12);
    background: rgba(255, 255, 255, 0.92);
}

header.scrolled nav>div.flex {
    min-height: 3.5rem;
}

/* ==========================================
   CTA BUTTON ATTENTION ANIMATION
========================================== */
@keyframes cta-glow {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(249, 115, 22, 0.3);
    }

    50% {
        box-shadow: 0 4px 30px rgba(249, 115, 22, 0.5), 0 0 0 4px rgba(249, 115, 22, 0.1);
    }
}

.cta-primary {
    animation: cta-glow 3s ease-in-out infinite;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cta-primary:hover {
    animation: none;
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(249, 115, 22, 0.4);
}

/* ==========================================
   ENHANCED NAV LINK HOVER STATES
   (excludes logo/brand links in #headerLogo)
========================================== */
header nav a:not(.bg-gradient-to-r):not(#headerLogo a):not(#headerLogo > a) {
    position: relative;
    transition: color 0.2s ease;
}

header nav a:not(.bg-gradient-to-r):not(#headerLogo a):not(#headerLogo > a)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #0ea5e9, #06b6d4);
    transition: width 0.3s ease;
}

header nav a:not(.bg-gradient-to-r):not(#headerLogo a):not(#headerLogo > a):hover::after {
    width: 100%;
}

/* Logo positioning adjustment - move down slightly */
#headerLogo {
    padding-top: 4px;
}

/* ==========================================
   STEP INDICATOR
========================================== */
.step-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #0ea5e9 0%, #06b6d4 100%);
    z-index: 0;
}

.step-circle {
    position: relative;
    z-index: 1;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
}

/* ==========================================
   TABLE STYLES
========================================== */
.bank-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.bank-table th {
    text-align: left;
    padding: 1rem;
    font-weight: 600;
    color: #64748b;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
}

.bank-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.bank-table tr:hover td {
    background: rgba(14, 165, 233, 0.03);
}

/* ==========================================
   FILTER PILL BUTTONS
========================================== */
.filter-pill {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.filter-pill:hover {
    background: #f0f9ff;
    border-color: #0ea5e9;
    color: #0ea5e9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.filter-pill.active {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
    transform: translateY(-1px);
}

.filter-pill.active:hover {
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5);
    transform: translateY(-2px);
}

/* ==========================================
   FILTER SECTION LAYOUT
========================================== */
.filter-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-group-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.filter-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .filter-section {
        flex-direction: row;
        align-items: flex-start;
    }

    .filter-group {
        flex: 1;
    }
}

/* ==========================================
   ACCORDION (FAQ)
========================================== */
.accordion-item {
    border-bottom: 1px solid rgba(14, 165, 233, 0.1);
}

.accordion-header {
    width: 100%;
    padding: 1.25rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    font-weight: 600;
    color: #0f172a;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

.accordion-header:hover {
    color: #0ea5e9;
}

.accordion-icon {
    transition: transform 0.3s ease;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    transition: all 0.3s ease-in-out;
    opacity: 0;
}

.accordion-item.active .accordion-content {
    max-height: 1000px; /* Increased for safety */
    padding-bottom: 1.5rem;
    opacity: 1;
}

/* ==========================================
   OWNER CARD (Calculator)
========================================== */
.owner-card {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(14, 165, 233, 0.15);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.owner-card:hover {
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.1);
}

/* ==========================================
   SLIDER STYLES
========================================== */
.exit-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #fed7aa 0%, #f97316 100%);
    outline: none;
}

.exit-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316, #ea580c);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.4);
    transition: transform 0.2s;
}

.exit-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* ==========================================
   PRODUCT CARDS
========================================== */
.product-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(14, 165, 233, 0.15);
}

.product-card-free {
    border: 2px solid rgba(14, 165, 233, 0.2);
}

.product-card-premium {
    border: 2px solid #0ea5e9;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(224, 242, 254, 0.5) 100%);
}

/* ==========================================
   RESPONSIVE
========================================== */
@media (max-width: 768px) {

    .bank-table th,
    .bank-table td {
        padding: 0.75rem 0.5rem;
    }

    .step-circle {
        width: 40px;
        height: 40px;
    }
}

/* ==========================================
   UTILITIES
========================================== */
.touch-target {
    min-height: 44px;
    min-width: 44px;
}

.text-gradient {
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================
   BANK MARQUEE ANIMATION
========================================== */
.bank-marquee {
    width: 100%;
    overflow: hidden;
}

.bank-marquee-content {
    display: flex;
    gap: 8rem;
    animation: marquee 120s linear infinite;
}

@media (max-width: 768px) {
    .bank-marquee-content {
        gap: 4rem;
        animation: marquee 60s linear infinite;
    }
}

.bank-logo-item {
    flex-shrink: 0;
    padding: 0.5rem 1.5rem;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.bank-logo-item:hover {
    opacity: 1;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ==========================================
   ARTICLE CARDS
========================================== */
.article-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 1.25rem;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(14, 165, 233, 0.1);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(14, 165, 233, 0.12);
}

.article-card-image {
    height: 160px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

/* ==========================================
   FOOTER LEGAL ACCORDION
========================================== */
.footer-accordion-header {
    width: 100%;
    padding: 0.75rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    font-weight: 500;
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    font-size: 0.875rem;
}

.footer-accordion-header:hover {
    color: white;
}

.footer-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.footer-accordion-item.active .footer-accordion-content {
    max-height: 600px;
}

.footer-accordion-item.active .footer-accordion-icon {
    transform: rotate(180deg);
}

.footer-accordion-icon {
    transition: transform 0.3s ease;
}

/* ==========================================
   CONTRACT QUIZ STYLES
========================================== */
.quiz-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.quiz-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quiz-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(14, 165, 233, 0.15);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-weight: 500;
    color: #334155;
}

.quiz-option:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #0ea5e9;
    transform: translateX(4px);
}

.quiz-option.selected {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    border-color: #0ea5e9;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.quiz-option-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.quiz-progress {
    margin-bottom: 1rem;
}

/* ==========================================
   MOBILE RESPONSIVE STYLES
   Multi-breakpoint support for all phone formats
========================================== */

/* Sticky Mobile CTA */
#stickyCta.visible {
    transform: translateY(0);
}

/* Add padding to body to prevent content overlap */
@media (max-width: 767px) {
    body.sticky-cta-active {
        padding-bottom: 76px;
    }
}

/* ---- LARGE PHONES & SMALL TABLETS (max-width: 640px) ---- */
@media (max-width: 640px) {

    /* Mobile Menu Enhancement */
    #mobileMenu {
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(14, 165, 233, 0.1);
        padding: 1rem;
        margin: 0 -1rem;
    }

    #mobileMenu a {
        padding: 0.875rem 1rem;
        border-radius: 0.75rem;
        transition: background 0.2s;
    }

    #mobileMenu a:hover {
        background: rgba(14, 165, 233, 0.05);
    }

    /* Fixed Navigation Header Alignment */
    header .flex-col {
        align-items: flex-start;
    }

    header .flex-col a.text-xl {
        line-height: 0.9 !important;
        padding-bottom: 0 !important;
        margin-bottom: -8px !important;
        display: block;
    }

    header .text-xs.text-slate-500 {
        margin-top: 0 !important;
    }

    /* Hero section reorder - mobile only */
    section[data-track-section="hero"] .text-center {
        display: flex !important;
        flex-direction: column !important;
    }

    /* €650k box first (order -2) */
    section[data-track-section="hero"] .text-center>.flex.justify-center.mt-8 {
        order: -2 !important;
        margin-top: 0 !important;
        margin-bottom: 1rem !important;
    }

    /* Trust badges second (order -1) */
    section[data-track-section="hero"] .text-center>.mt-8.flex.flex-wrap {
        order: -1 !important;
        margin-top: 0 !important;
        margin-bottom: 1.5rem !important;
    }

    /* Typography Scaling */
    h1 {
        font-size: 1.875rem !important;
        /* text-3xl */
        line-height: 1.2 !important;
    }

    h2 {
        font-size: 1.5rem !important;
        /* text-2xl */
    }

    /* Section Padding Reduction */
    section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    /* Social Proof - 2 Column Grid */
    .social-proof-stats,
    section[data-track-section="social_proof"]>div>div {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .social-proof-stats>div,
    section[data-track-section="social_proof"]>div>div>div {
        text-align: center;
        padding: 0.75rem;
    }

    /* Bank Table - Improved Card Layout with Side-by-Side Button */
    .bank-table {
        display: block !important;
        width: 100% !important;
    }

    .bank-table thead {
        display: none !important;
    }

    .bank-table tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    .bank-table tr {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 1rem !important;
        background: rgba(255, 255, 255, 0.9) !important;
        border-radius: 1rem !important;
        border: 1px solid rgba(14, 165, 233, 0.1) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02) !important;
        position: relative;
    }

    /* Bank Logo & Name (Top Left) */
    .bank-table td:first-child {
        display: block !important;
        width: auto !important;
        padding: 0 !important;
        border: none !important;
        margin-right: auto;
        margin-bottom: 0.5rem;
        flex: 1 1 100%;
        /* Force new line for interest if needed, or adjust */
    }

    /* Tweaking first child flex to keep logo on top row full width or shared */
    .bank-table td:first-child {
        flex: 1 1 100%;
        margin-bottom: 0.75rem;
        border-bottom: 1px solid #f1f5f9 !important;
        padding-bottom: 0.75rem !important;
    }

    /* Interest Rate & Tags (Bottom Left) */
    .bank-table td:nth-child(2),
    .bank-table td:nth-child(3) {
        display: block !important;
        width: auto !important;
        padding: 0 !important;
        border: none !important;
    }

    /* Group Rate and Features together if possible or just stack them on left */
    .bank-table td:nth-child(2) {
        margin-right: 1rem;
    }

    /* Button (Bottom Right) */
    .bank-table td:last-child {
        display: block !important;
        width: auto !important;
        padding: 0 !important;
        border: none !important;
        margin-left: auto;
        /* Push to right */
    }

    .bank-table td:last-child a {
        display: inline-flex !important;
        width: auto !important;
        padding: 0.5rem 1rem !important;
        font-size: 0.875rem !important;
    }

    /* Filter Pills - Proper Wrapping */
    .filter-pills-row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .filter-pill {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }

    /* Calculator Buttons - Stack Vertically */
    #addOwnerBtn,
    #resetBtn {
        flex: 1 1 100%;
    }

    /* Owner Card Input Labels */
    .owner-card label {
        font-size: 0.875rem;
    }

    /* Accordion Scroll Offset */
    .accordion-item {
        scroll-margin-top: 5rem;
    }

    /* Step Cards */
    .glass-card .flex.items-start {
        flex-direction: column;
    }

    .glass-card .flex.items-start>div:first-child {
        margin-bottom: 1rem;
    }

    /* Footer Improvements */
    footer .border-t {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    footer .flex.items-center.gap-4 {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ---- SMALL PHONES (max-width: 480px) ---- */
@media (max-width: 480px) {

    /* Even smaller typography */
    h1 {
        font-size: 1.5rem !important;
        /* text-2xl */
    }

    h2 {
        font-size: 1.25rem !important;
        /* text-xl */
    }

    /* Tighter container padding */
    .max-w-6xl,
    .max-w-4xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Step circles smaller */
    .step-circle {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }

    /* Filter pills full row */
    .filter-pill {
        flex: 1 1 calc(50% - 0.25rem);
        text-align: center;
        justify-content: center;
    }

    /* Hero trust badges stack */
    .flex.flex-wrap.items-center.justify-center.gap-6 {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Product cards full width */
    .product-card {
        width: 100%;
    }

    /* CTA buttons full width */
    .inline-flex.items-center.gap-2 {
        width: 100%;
        justify-content: center;
    }

    /* Social proof - single column on very small screens */
    section[data-track-section="social_proof"]>div>div {
        grid-template-columns: 1fr 1fr;
    }

    /* Calculator results grid */
    .grid.grid-cols-2.md\\:grid-cols-4 {
        grid-template-columns: 1fr 1fr;
    }
}

/* ---- FLUID TYPOGRAPHY (for smooth scaling) ---- */
@media (max-width: 768px) {

    /* Clamp-based fluid scaling for hero elements */
    .text-4xl,
    .text-5xl,
    .text-6xl {
        font-size: clamp(1.5rem, 5vw, 3rem) !important;
    }

    .text-3xl {
        font-size: clamp(1.25rem, 4vw, 1.875rem) !important;
    }

    /* Results number scaling */
    #mortgageResult {
        font-size: clamp(2rem, 10vw, 3.75rem) !important;
    }
}

/* ---- TOUCH TARGET IMPROVEMENTS ---- */
@media (max-width: 768px) {

    /* Ensure minimum 44px touch targets */
    button,
    a,
    input,
    select,
    .filter-pill,
    .accordion-header,
    .quiz-option {
        min-height: 44px;
    }

    /* Better input sizing */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    select {
        font-size: 16px;
        /* Prevents iOS zoom on focus */
        padding: 0.875rem 1rem;
    }
}

/* ---- PREVENT HORIZONTAL OVERFLOW ---- */
@media (max-width: 768px) {

    html,
    body {
        overflow-x: hidden;
    }

    main,
    section,
    footer,
    header {
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Table container scroll */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}