/* Alpine.js x-cloak - Hide elements until Alpine.js initializes */
[x-cloak] {
    display: none !important;
}

/* Contact consent checkbox: two-column layout so text wraps under itself, not under checkbox */
/* Lead gen forms: text left-aligned (never centered), checkbox 1.25rem for consistency with tools */
.contact-consent-notice.contact-consent-checkbox {
    display: flex !important;
    align-items: flex-start;
    gap: 0.5rem;
    text-align: left;
}
.contact-consent-notice.contact-consent-checkbox input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 0.125rem;
    width: 1.25rem;
    height: 1.25rem;
    min-width: 1.25rem;
    min-height: 1.25rem;
}
.contact-consent-notice.contact-consent-checkbox .contact-consent-text {
    flex: 1 1 0%;
    min-width: 14rem; /* Ensures 2-line wrap for consent text */
}

/* GDPR-compliant visibility: subtle checkbox highlight only (no animation). See docs/systems/gdpr/CONSENT_CHECKBOX_DARK_PATTERNS.md */
.contact-consent-notice.contact-consent-checkbox.contact-consent-visible input[type="checkbox"] {
    border: 2px solid #4d8ef3 !important;
}
/* Lead gen modals: readable consent text (WCAG AA, 14px min) */
.contact-consent-notice.contact-consent-checkbox.contact-consent-visible .contact-consent-text {
    font-size: 0.75rem;
    color: #4b5563;
    line-height: 1.4;
}

.template-customizer{background:#f8fafc;border-radius:1rem;padding:2rem;margin:2rem 0}.template-preview{border:2px solid #e5e7eb;border-radius:0.75rem;overflow:hidden;background:white;box-shadow:0 10px 15px -3px rgba(0,0,0,0.1);transition:all 0.3s ease}.template-preview:hover{border-color:#4D8EF3;box-shadow:0 20px 25px -5px rgba(0,0,0,0.1)}.template-controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:1rem;margin:1.5rem 0}.template-control-group{display:flex;flex-direction:column;gap:0.5rem}.template-control-group label{font-weight:600;color:#374151;font-size:0.875rem}.template-control-group input,.template-control-group select{padding:0.75rem;border:1px solid #d1d5db;border-radius:0.5rem;font-size:0.875rem;transition:all 0.2s ease}.template-control-group input:focus,.template-control-group select:focus{outline:none;border-color:#4D8EF3;box-shadow:0 0 0 3px rgba(77,142,243,0.1)}.color-picker{display:flex;align-items:center;gap:0.5rem}.color-picker input[type="color"]{width:3rem;height:3rem;border:none;border-radius:0.5rem;cursor:pointer;background:none}.color-picker input[type="color"]::-webkit-color-swatch-wrapper{padding:0;border-radius:0.5rem;overflow:hidden}.color-picker input[type="color"]::-webkit-color-swatch{border:none;border-radius:0.5rem}.template-download{background:linear-gradient(135deg,#10b981 0%,#059669 100%);color:white;padding:1rem 2rem;border-radius:0.5rem;font-weight:600;text-decoration:none;display:inline-flex;align-items:center;gap:0.5rem;transition:all 0.3s ease;border:none;cursor:pointer}.template-download:hover{transform:translateY(-2px);box-shadow:0 10px 25px rgba(16,185,129,0.3);color:white}.template-categories{display:flex;flex-wrap:wrap;gap:0.5rem;margin:1.5rem 0}.template-category{padding:0.5rem 1rem;background:#f3f4f6;color:#6b7280;border-radius:2rem;font-size:0.875rem;font-weight:500;cursor:pointer;transition:all 0.2s ease;border:1px solid transparent}.template-category:hover,.template-category.active{background:#4D8EF3;color:white;border-color:#4D8EF3}.template-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:2rem;margin:2rem 0}.template-card{background:white;border-radius:0.75rem;overflow:hidden;box-shadow:0 4px 6px -1px rgba(0,0,0,0.1);transition:all 0.3s ease;border:1px solid #e5e7eb}.template-card:hover{transform:translateY(-4px);box-shadow:0 20px 25px -5px rgba(0,0,0,0.1)}.template-card-image{width:100%;height:200px;object-fit:cover;background:#f9fafb}.template-card-content{padding:1.5rem}.template-card-title{font-size:1.125rem;font-weight:600;color:#111827;margin-bottom:0.5rem}.template-card-description{color:#6b7280;font-size:0.875rem;line-height:1.5;margin-bottom:1rem}.template-card-actions{display:flex;gap:0.75rem;align-items:center}.template-modal{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.8);z-index:9999;display:flex;align-items:center;justify-content:center;padding:2rem}.template-modal-content{background:white;border-radius:1rem;max-width:90vw;max-height:90vh;overflow:auto;position:relative}.template-modal-close{position:absolute;top:1rem;right:1rem;background:rgba(0,0,0,0.5);color:white;border:none;border-radius:50%;width:2.5rem;height:2.5rem;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:10}.form-builder{background:white;border:1px solid #e5e7eb;border-radius:0.75rem;padding:1.5rem;margin:1.5rem 0}.form-builder-toolbar{display:flex;gap:0.5rem;margin-bottom:1rem;padding-bottom:1rem;border-bottom:1px solid #e5e7eb}.form-builder-toolbar button{padding:0.5rem 1rem;background:#f3f4f6;border:1px solid #d1d5db;border-radius:0.375rem;cursor:pointer;font-size:0.875rem;transition:all 0.2s ease}.form-builder-toolbar button:hover{background:#e5e7eb}.form-builder-canvas{min-height:200px;border:2px dashed #d1d5db;border-radius:0.5rem;padding:1rem;background:#fafafa}.export-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:1rem;margin:1.5rem 0}.export-option{display:flex;flex-direction:column;align-items:center;gap:0.5rem;padding:1rem;border:1px solid #e5e7eb;border-radius:0.5rem;cursor:pointer;transition:all 0.2s ease}.export-option:hover{border-color:#4D8EF3;background:#f8faff}.export-option-icon{width:2rem;height:2rem;color:#6b7280}.export-option-label{font-size:0.875rem;font-weight:500;color:#374151}@media (max-width:768px){.template-customizer{padding:1rem;margin:1rem 0}.template-controls{grid-template-columns:1fr}.template-grid{grid-template-columns:1fr;gap:1rem}.template-categories{justify-content:center}.template-modal{padding:1rem}.template-modal-content{max-width:95vw;max-height:95vh}.form-builder-toolbar{flex-wrap:wrap}.export-options{grid-template-columns:repeat(2,1fr)}}/* Force all export buttons to be visible with maximum specificity */
button[onclick*="exportToExcel"],
button[onclick*="exportToPDF"],
button[onclick*="exportToCSV"] {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    background-color: inherit !important;
    color: inherit !important;
}

/* Alpine.js click handlers - styled separately to avoid CSS parsing issues */
[x-on\:click*="exportTo"] {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Step Navigation Styling */
.step-navigation button[role="tab"] {
    min-width: 80px;
    justify-content: center;
}

.step-navigation button[role="tab"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.step-navigation button[role="tab"]:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Navigation Button Hover Effects */
.step-navigation button:not([role="tab"]):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Responsive Navigation */
@media (max-width: 768px) {
    .step-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .step-navigation button[role="tab"] {
        min-width: auto;
        flex: 1;
    }
}

/* Specific button styling to override any conflicts */
button[onclick*="exportToExcel"] {
    background-color: #059669 !important; /* green-600 */
    color: white !important;
}

button[onclick*="exportToPDF"] {
    background-color: #dc2626 !important; /* red-600 */
    color: white !important;
}

button[onclick*="exportToCSV"] {
    background-color: #2563eb !important; /* blue-600 */
    color: white !important;
}

/* Hover effects */
button[onclick*="exportToExcel"]:hover {
    background-color: #047857 !important; /* green-700 */
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

button[onclick*="exportToPDF"]:hover {
    background-color: #b91c1c !important; /* red-700 */
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

button[onclick*="exportToCSV"]:hover {
    background-color: #1d4ed8 !important; /* blue-700 */
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

/* Focus states for accessibility */
button:focus {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* Excel Visual Component Styles */
.excel-visual-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 100%;
    position: relative;
}

/* Ensure fade effect works properly */
.excel-visual-container > div {
    position: relative;
}

/* Cleaner cell styling - matching pillar page aesthetic */
.excel-visual-container .bg-white {
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.excel-visual-container .bg-white:hover {
    background-color: #f8f9fa;
}

.excel-visual-container .bg-gray-50 {
    transition: background-color 0.15s ease;
}

.excel-visual-container .bg-gray-100 {
    transition: background-color 0.15s ease;
}

/* Ensure borders are subtle and clean */
.excel-visual-container .border-gray-200 {
    border-color: #e5e7eb;
}

.excel-visual-container .border-gray-300 {
    border-color: #d1d5db;
}

.excel-visual-container .border-gray-400 {
    border-color: #9ca3af;
}

/* Mobile optimization for Excel visual */
@media (max-width: 768px) {
    .excel-grid-container {
        max-height: 400px;
    }
    
    .excel-visual-container {
        font-size: 0.75rem;
    }
    
    .excel-data-cell,
    .excel-header-cell {
        min-width: 80px;
        padding: 0.25rem;
        font-size: 0.7rem;
    }
    
    .excel-row-number {
        width: 40px;
        font-size: 0.7rem;
    }
    
    .excel-menu-bar {
        font-size: 0.65rem;
        padding: 0.5rem;
    }
    
    .excel-formula-bar {
        font-size: 0.65rem;
        padding: 0.5rem;
    }
}

/* Template hero title: hyphenate only very long words (e.g. Arbeitsbescheinigung 21 chars), not short ones (e.g. kostenlos 9 chars) */
.template-hero-title {
  hyphens: auto;
  hyphenate-limit-chars: 15 2 2; /* min 15 chars before hyphenation; 2 before/after hyphen */
  overflow-wrap: break-word;
}

/* Hero section mobile optimization */
@media (max-width: 1024px) {
    .template-hero-section {
        grid-template-columns: 1fr !important;
    }
    
    .template-hero-section > div:first-child {
        order: 2;
    }
    
    .template-hero-section > div:last-child {
        order: 1;
    }
}

/* Ensure text is always visible */
button[onclick*="exportTo"] h6,
button[onclick*="exportTo"] p {
    color: white !important;
}

/* Ensure icons are visible */
button[onclick*="exportTo"] svg {
    fill: white !important;
}

/* Force text visibility with maximum specificity */
button[onclick*="exportToExcel"] h6,
button[onclick*="exportToExcel"] p,
button[onclick*="exportToPDF"] h6,
button[onclick*="exportToPDF"] p,
button[onclick*="exportToCSV"] h6,
button[onclick*="exportToCSV"] p {
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Override any potential text color conflicts */
button[onclick*="exportTo"] * {
    color: white !important;
}

/* Ensure button content is always visible */
button[onclick*="exportTo"] {
    position: relative !important;
    z-index: 10 !important;
}

/* Format Selection - Segmented Control Pattern */
.template-format-selection {
    display: inline-flex;
    background: #f3f4f6;
    border-radius: 0.5rem;
    padding: 0.25rem;
    gap: 0.125rem;
    width: 100%;
    box-sizing: border-box;
}

.template-format-selection input[type="radio"] {
    display: none;
}

.template-format-selection label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    background: transparent;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    border: none;
    margin: 0;
}

.template-format-selection input[type="radio"]:checked + label {
    background: white;
    color: #4d8ef3;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    font-weight: 600;
}

.template-format-selection label:hover:not(:has(input:checked)):not(.disabled) {
    color: #374151;
    background: rgba(77, 142, 243, 0.05);
}

.template-format-selection label.disabled {
    cursor: not-allowed;
    opacity: 0.6;
    background: rgba(0, 0, 0, 0.02);
}

.template-format-selection label.disabled:hover {
    background: rgba(0, 0, 0, 0.02);
    color: #6b7280;
}

/* Mobile responsive adjustments for format selection */
@media (max-width: 640px) {
    .template-format-selection {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .template-format-selection label {
        width: 100%;
        padding: 0.75rem 1rem;
    }
}

/* Ensure customizer form submit button is visible */
button[type="submit"] {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Specific styling for customizer form submit button */
form button[type="submit"] {
    background: linear-gradient(to right, #2563eb, #1d4ed8) !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

form button[type="submit"]:hover {
    background: linear-gradient(to right, #1d4ed8, #1e40af) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}

form button[type="submit"]:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Prevent main page scrolling when customizer is open */
body.customizer-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100vh;
    top: 0;
    left: 0;
}

html.customizer-open {
    overflow: hidden !important;
    height: 100vh;
}

/* Additional prevention for any potential scrolling */
body.customizer-open * {
    overflow: hidden !important;
}

/* Allow scrolling only in customizer scroll area */
.customizer-scroll-area {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Custom Scrolling for Customizer Steps */
.customizer-scroll-area {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
    height: calc(100vh - 200px);
    max-height: calc(100vh - 200px);
    overflow-y: auto !important;
    overflow-x: hidden !important;
    position: relative;
    z-index: 1;
}

.customizer-scroll-area::-webkit-scrollbar {
    width: 8px;
}

.customizer-scroll-area::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.customizer-scroll-area::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.customizer-scroll-area::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Step Container Scrolling - Override the global overflow hidden */
.step-container {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    max-height: 80vh !important;
}

.step-container::-webkit-scrollbar {
    width: 6px;
}

.step-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.step-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.step-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Ensure smooth scrolling behavior */
.step-container {
    scroll-behavior: smooth;
}

/* Prevent horizontal scrolling within steps */
.step-container {
    overflow-x: hidden;
}

/* Force scrolling to work in step containers */
.step-container {
    overflow-y: auto !important;
    height: auto !important;
    max-height: 80vh !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Ensure step containers are scrollable on all devices */
.step-container {
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth !important;
}

/* Override any potential conflicting styles */
.step-container * {
    overflow: visible !important;
}

.step-container {
    overflow: visible !important;
}

.step-container {
    overflow-y: auto !important;
}

/* ADAPTIVE SCROLLING SOLUTION - Responsive to viewport and content */
.step-container {
    height: auto !important;
    min-height: 600px;
    max-height: calc(100vh - 200px) !important; /* Adaptive to viewport */
    overflow-y: auto !important;
    overflow-x: hidden !important;
    position: relative !important;
    z-index: 10 !important;
    scroll-behavior: smooth !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 2rem !important; /* Ensure bottom content is visible */
}

/* Ensure proper spacing at bottom of scrollable content */
.step-container > *:last-child {
    margin-bottom: 1rem !important;
}

/* Responsive height adjustments for different screen sizes */
@media (max-width: 768px) {
    .step-container {
        max-height: calc(100vh - 150px) !important; /* Mobile: account for smaller headers */
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .step-container {
        max-height: calc(100vh - 200px) !important; /* Tablet: balanced approach */
    }
}

@media (min-width: 1025px) {
    .step-container {
        max-height: calc(100vh - 200px) !important; /* Desktop: full height minus header space */
    }
}

/* Large screens - allow more content visibility */
@media (min-width: 1440px) {
    .step-container {
        max-height: calc(100vh - 220px) !important; /* Large screens: more space */
    }
}

/* Ultra-wide screens */
@media (min-width: 1920px) {
    .step-container {
        max-height: calc(100vh - 240px) !important; /* Ultra-wide: maximum space */
    }
}

/* Ensure content can flow naturally within containers */
.step-container > * {
    height: auto !important;
    max-height: none !important;
}

/* Force scrolling when customizer is open */
body.customizer-open .step-container {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Ensure scrolling works in all contexts */
.customizer-scroll-area .step-container {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Additional adaptive scrolling enhancements */
.step-container {
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 #F1F5F9;
}

.step-container::-webkit-scrollbar {
    width: 8px;
}

.step-container::-webkit-scrollbar-track {
    background: #F1F5F9;
    border-radius: 4px;
}

.step-container::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

.step-container::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* Ensure buttons at bottom are always accessible */
.step-container button,
.step-container .btn,
.step-container a[href="#"] {
    position: relative;
    z-index: 5;
}

/* Dynamic height adjustment for very small screens */
@media (max-height: 600px) {
    .step-container {
        max-height: calc(100vh - 100px) !important;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .step-container {
        max-height: calc(100vh - 120px) !important;
    }
}

/* Fix dropdown styling and positioning */
.custom-dropdown {
    position: relative !important;
    display: inline-block !important;
    width: 100% !important;
    overflow: visible !important;
}

.custom-dropdown select {
    width: 100%;
    padding-right: 2.5rem !important;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: none !important;
}

.custom-dropdown .chevron {
    position: absolute !important;
    top: 50% !important;
    right: 0 !important;
    transform: translateY(-50%) !important;
    pointer-events: none !important;
    z-index: 10 !important;
}

/* Ensure dropdown container has proper positioning */
.custom-dropdown select:focus + .chevron {
    color: #286bcd;
}

/* Smooth scrolling for step transitions */
.step-content {
    scroll-behavior: smooth;
}

/* Ensure proper height calculations */
.customizer-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.customizer-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Consistent step layout */
.step-content {
    width: 100%;
    max-width: 100%;
}

.step-content > div {
    width: 100%;
    max-width: 100%;
}

/* Prevent layout shifts between steps */
.customizer-scroll-area {
    min-width: 0;
    width: 100%;
}

/* Fixed Navigation Layout */
.navigation-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
}

.navigation-left {
    width: 120px;
    flex-shrink: 0;
    display: flex;
    justify-content: flex-start;
}

.navigation-center {
    width: 600px;
    flex-shrink: 0;
}

.navigation-right {
    width: 120px;
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
}

/* Ensure navigation buttons don't cause layout shifts */
.nav-button {
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.nav-button[x-show="false"] {
    opacity: 0;
    transform: scale(0.95);
}

/* Advanced Settings Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 24px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #3b82f6;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 1px #3b82f6;
}

/* Enhanced Dropdown Styling */
.custom-dropdown {
    position: relative !important;
    display: inline-block !important;
    width: 100% !important;
    overflow: visible !important;
}

.custom-dropdown select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background: white !important;
    cursor: pointer !important;
    padding-right: 2.5rem !important;
    transition: all 0.2s ease-in-out !important;
}

.custom-dropdown select:hover {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.custom-dropdown select:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    outline: none !important;
}

.custom-dropdown .chevron {
    position: absolute !important;
    right: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    pointer-events: none !important;
    z-index: 10 !important;
    transition: transform 0.2s ease-in-out !important;
}

.custom-dropdown select:focus + .chevron {
    transform: translateY(-50%) rotate(180deg);
}

/* Ensure consistent dropdown appearance across browsers */
.custom-dropdown select::-ms-expand {
    display: none;
}

/* Firefox specific styling */
@-moz-document url-prefix() {
    .custom-dropdown select {
        background-image: none;
    }
}

/* Safari specific styling */
@supports (-webkit-appearance: none) {
    .custom-dropdown select {
        background-image: none;
    }
}

/* ============================================
   TEMPLATE CTA SECTION STYLES
   ============================================ */

/* ============================================
   TEMPLATE CTA SECTION STYLES
   ============================================ */

/* CTA Section Container */
.template-cta-section {
    position: relative;
    overflow: visible;
    width: 100%;
}

/* Ensure proper spacing and visual hierarchy */
.template-cta-section > div {
    width: 100%;
}

/* Headline section spacing */
.template-cta-section > div > div:first-child {
    margin-bottom: 3rem;
}

@media (min-width: 1024px) {
    .template-cta-section > div > div:first-child {
        margin-bottom: 4rem;
    }
}

/* Benefit Cards */
.template-cta-benefit-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.template-cta-benefit-card:hover {
    transform: translateY(-2px);
    border-color: #e0e7ff;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.template-cta-benefit-card:focus-within {
    outline: 2px solid #4D8EF3;
    outline-offset: 2px;
}

/* Benefit card content: Prevent overflow */
.template-cta-benefit-card .flex-1 {
    min-width: 0; /* Allow flex item to shrink */
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.template-cta-benefit-card h3 {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.template-cta-benefit-card p {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

/* Feature Cards Grid */
.template-cta-features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* Tablet: 2 columns */
@media (min-width: 768px) {
    .template-cta-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: Dynamic columns based on number of cards */
/* 2 cards: 2 columns, 3 cards: 3 columns */
@media (min-width: 1024px) {
    .template-cta-features-grid {
        /* Default to 3 columns, but will be overridden by Tailwind classes */
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* When grid has exactly 2 children, use 2 columns */
    .template-cta-features-grid:has(> :nth-child(2):last-child) {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Explicit 2-column class (set by PHP) */
    .template-cta-features-grid.lg\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Feature Card Styling */
.template-cta-feature-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
    text-decoration: none;
    min-height: 120px;
}

.template-cta-feature-card:hover {
    transform: translateY(-2px);
    border-color: #4D8EF3;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.template-cta-feature-card:focus {
    outline: 2px solid #4D8EF3;
    outline-offset: 2px;
}

.template-cta-feature-card svg {
    transition: transform 0.2s ease;
}

.template-cta-feature-card:hover svg {
    transform: translateX(4px);
}

/* Features Section Spacing */
.template-cta-features-section {
    width: 100%;
}

/* CTA Right Column Sticky - REMOVED */

/* Content Wrapper */
.template-cta-content-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Benefits Grid: 2x2 on desktop, single column on mobile */
.template-cta-benefits-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 1024px) {
    .template-cta-benefits-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Benefits Section Spacing */
.template-cta-benefits-section {
    width: 100%;
}

/* CTA Buttons Section */
.template-cta-buttons-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* CTA Buttons Container - Standard Layout */
.template-cta-buttons-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Let include_ctabuttons.php handle button layout naturally */
.template-cta-buttons-container > div {
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}


/* Responsive Adjustments */
@media (max-width: 1023px) {
    .template-cta-benefits-section {
        margin-bottom: 2.5rem;
    }
    
    .template-cta-features-section {
        margin-bottom: 2.5rem;
    }
    
    .template-cta-buttons-section {
        margin-top: 1rem;
    }
}

@media (max-width: 640px) {
    .template-cta-section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    .template-cta-section h2 {
        font-size: 1.875rem;
        line-height: 1.1;
        margin-bottom: 1rem;
    }
    
    .template-cta-section p {
        font-size: 1rem;
    }
    
    .template-cta-benefit-card {
        padding: 1rem;
    }
    
    .template-cta-benefit-card .w-11,
    .template-cta-benefit-card .w-12 {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .template-cta-benefit-card .w-11 svg,
    .template-cta-benefit-card .w-12 svg {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    /* Mobile: Feature cards full width */
    .template-cta-feature-card {
        min-height: 100px;
        padding: 1rem;
    }
    
    /* Mobile: Optimize spacing */
    .template-cta-benefits-section {
        margin-bottom: 2rem;
    }
    
    .template-cta-features-section {
        margin-bottom: 2rem;
    }
    
    .template-cta-buttons-section {
        margin-top: 0.5rem;
    }
}

/* Tablet adjustments */
@media (min-width: 641px) and (max-width: 1023px) {
    .template-cta-section .grid {
        gap: 2.5rem;
    }
    
    .template-cta-benefit-card {
        padding: 1.25rem 1.5rem;
    }
}

/* Tablet adjustments */
@media (min-width: 641px) and (max-width: 1023px) {
    .template-cta-section .grid {
        gap: 3rem;
    }
}

/* Desktop improvements */
@media (min-width: 1024px) {
    /* Left column: Better structure and alignment */
    .template-cta-left-column {
        min-width: 0;
        overflow-wrap: break-word;
        word-wrap: break-word;
        display: flex;
        flex-direction: column;
    }
    
    /* Right column: Proper width and alignment */
    .template-cta-right-column {
        width: 100%;
        min-width: 0;
        display: flex;
        flex-direction: column;
    }
    
    /* Align CTA card with first benefit card visually */
    .template-cta-card {
        margin-top: 0;
        align-self: flex-start;
    }
    
    /* Benefit cards wrapper: Consistent spacing */
    .template-cta-benefits-wrapper {
        flex: 1;
    }
    
    /* Benefit cards: Prevent overflow */
    .template-cta-benefit-card {
        max-width: 100%;
    }
    
    /* Feature links: Better wrapping */
    .template-cta-feature-link {
        max-width: 100%;
    }
}

/* Accessibility: Focus States */
.template-cta-feature-link:focus-visible,
.template-cta-benefit-card:focus-visible {
    outline: 2px solid #4D8EF3;
    outline-offset: 2px;
}

/* Ensure proper text wrapping */
.template-cta-feature-link span {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* site-faq-section.php on template pages: FAQ answer links — underline on interaction; focus via underline */
#faq .ordio-faq-answer a {
    color: #4d8ef3;
    font-weight: 500;
    text-decoration: none;
    text-decoration-color: rgba(40, 107, 205, 0.55);
    text-underline-offset: 0.18em;
    text-decoration-thickness: 1px;
    text-decoration-skip-ink: auto;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
#faq .ordio-faq-answer a:hover {
    color: #286bcd;
    text-decoration: underline;
    text-decoration-color: rgba(40, 107, 205, 0.5);
}
#faq .ordio-faq-answer a:focus-visible {
    outline: none;
    text-decoration: underline;
    text-decoration-color: #286bcd;
    text-decoration-thickness: 2px;
    color: #286bcd;
}

/* Print Styles */
@media print {
    .template-cta-section {
        page-break-inside: avoid;
    }
    
    .template-cta-section .lg\:sticky {
        position: relative;
    }
}
