/* Custom CSS for Funnel Form */

/* Tailwind Config */
@layer base {
    :root {
        --color-primary: #f6ae42;
        --color-primary-dark: #e89a2e;
    }
}

/* Custom Properties */
.bg-primary {
    background-color: #f6ae42;
}

.bg-primary-dark {
    background-color: #e89a2e;
}

.text-primary {
    color: #f6ae42;
}

.border-primary {
    border-color: #f6ae42;
}

.focus\:ring-primary:focus {
    --tw-ring-color: #f6ae42;
}

/* Font Classes */
.font-heading {
    font-family: 'Montserrat', sans-serif;
}

.font-sans {
    font-family: 'Open Sans', sans-serif;
}

/* Step Management */
.step {
    display: none;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 24px 0 rgba(0,0,0,0.08);
    max-width: 520px;
    margin: 0 auto;
    padding: 2.5rem 2rem 2rem 2rem;
    width: 100%;
    animation: fadeIn 0.3s ease-in-out;
    align-items: stretch;
    justify-content: center;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 700px) {
    .step {
        max-width: 100vw;
        border-radius: 0;
        padding: 1.2rem 0.5rem 1.5rem 0.5rem;
        min-height: 100vh;
    }
}

.step.active {
    display: block;
}

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

/* Custom Radio Buttons */
.radio-custom {
    position: relative;
    transition: all 0.2s ease;
}

input[type="radio"]:checked + .radio-custom {
    border-color: #f6ae42;
    background-color: #f6ae42;
}

input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
}

/* Custom Checkboxes */
.checkbox-custom {
    position: relative;
    transition: all 0.2s ease;
}

input[type="checkbox"]:checked + .checkbox-custom {
    border-color: #f6ae42;
    background-color: #f6ae42;
}

input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
}

/* Label Hover Effects */
label:hover .radio-custom,
label:hover .checkbox-custom {
    border-color: #f6ae42;
}

label:hover {
    border-color: #f6ae42;
}

/* Selected State */
label:has(input[type="radio"]:checked),
label:has(input[type="checkbox"]:checked) {
    border-color: #f6ae42;
    background-color: #fef7ed;
}

/* Button Styles */
.btn-primary {
    background-color: #f6ae42;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #e89a2e;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: transparent;
    color: #6b7280;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #d1d5db;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

/* Form Input Styles */
input[type="text"],
input[type="email"] {
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus {
    outline: none;
    border-color: #f6ae42;
    box-shadow: 0 0 0 3px rgba(246, 174, 66, 0.1);
}

/* Progress Bar Animation */
#progress-bar {
    transition: width 0.3s ease;
}

/* Loading Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h1 {
        font-size: 1.875rem;
    }
    
    .step h2 {
        font-size: 1.25rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 10px 20px;
        font-size: 0.875rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .step,
    #progress-bar,
    .btn-primary,
    .btn-secondary {
        transition: none;
    }
    
    .animate-spin {
        animation: none;
    }
}

/* Focus Styles for Accessibility */
.btn-primary:focus,
.btn-secondary:focus,
input[type="text"]:focus,
input[type="email"]:focus {
    outline: 2px solid #f6ae42;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .bg-primary {
        background-color: #000;
        color: #fff;
    }
    
    .border-primary {
        border-color: #000;
    }
}

/* Print Styles */
@media print {
    .btn-primary,
    .btn-secondary,
    #loading-overlay {
        display: none !important;
    }
    
    .step.active {
        display: block !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #e89a2e;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Container Height for iframe */
body {
    min-height: 600px;
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Funnel-Formular: Slide/Karten-Feeling mit immer sichtbarem Button */
.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
}

#funnel-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 700px;
    background: white;
    position: relative;
    overflow: hidden;
}

.form-content {
    flex: 1 1 auto;
    overflow-y: auto;
    padding-bottom: 2rem;
    min-height: 0;
}

.form-buttons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    padding: 2rem 1rem 1rem 1rem;
    background: white;
    margin-top: auto;
    box-shadow: 0 -2px 16px 0 rgba(0,0,0,0.03);
    position: static;
}

/* Smooth scrolling for iframe */
html {
    scroll-behavior: smooth;
    height: 100%;
}

/* Prevent body from growing beyond iframe */
#funnel-form {
    overflow: hidden;
    position: relative;
    min-height: 700px;
}

/* Form Container Shadow */
.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Success Animation */
@keyframes successPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.success-animation {
    animation: successPulse 0.6s ease-in-out;
}

/* Error States */
.error {
    border-color: #ef4444 !important;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Conditional Step Styling */
.step[data-conditional] {
    opacity: 0.5;
    pointer-events: none;
}

.step[data-conditional].active {
    opacity: 1;
    pointer-events: all;
}

/* Mobile Touch Improvements */
@media (hover: none) and (pointer: coarse) {
    .btn-primary,
    .btn-secondary {
        min-height: 44px;
    }
    
    input[type="text"],
    input[type="email"] {
        min-height: 44px;
    }
    
    label {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Mobile-Optimierung: Slide-Feeling auf 100vh */
@media (max-width: 600px) {
    .container, .step {
        min-height: 100vh;
        height: 100vh;
        padding: 10px;
    }
}

/* Antwortoptionen als Kacheln nebeneinander */
.space-y-4, .grid-cols-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
    align-items: stretch;
}
@media (max-width: 700px) {
    .space-y-4, .grid-cols-2 {
        grid-template-columns: 1fr;
    }
}

label.flex, .step .space-y-4 > label, .step .grid-cols-2 > label {
    min-height: 120px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    box-sizing: border-box;
}

label.flex .checkbox-custom, label.flex .radio-custom {
    margin-bottom: 1rem;
    margin-right: 0;
}

/* Form Content mit eigenem Scrollbereich */
.form-content {
    overflow-y: auto;
    max-height: 600px;
    padding-bottom: 120px; /* Platz für Buttons */
}
@media (max-width: 700px) {
    .form-content {
        max-height: 80vh;
        padding-bottom: 140px;
    }
}

/* Button-Leiste immer unten */
.form-buttons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    padding: 2rem 1rem 1rem 1rem;
    background: white;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 -2px 16px 0 rgba(0,0,0,0.03);
}

.container {
    position: relative;
    min-height: 800px;
}

#funnel-form {
    overflow: hidden;
    position: relative;
    min-height: 700px;
}

@media (max-width: 700px) {
    .container {
        padding-top: 0;
        padding-bottom: 0;
    }
}

.card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 24px 0 rgba(0,0,0,0.08);
    max-width: 520px;
    margin: 0 auto;
    padding: 2.5rem 2rem 2rem 2rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
@media (max-width: 700px) {
    .card {
        max-width: 100vw;
        border-radius: 0;
        padding: 1.2rem 0.5rem 1.5rem 0.5rem;
    }
}

.kachel-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    align-items: stretch;
    justify-items: stretch;
}

.kachel-grid > label {
    min-height: 120px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    box-sizing: border-box;
    flex-grow: 1;
}

.kachel-grid > label .checkbox-custom,
.kachel-grid > label .radio-custom {
    margin-bottom: 1rem;
    margin-right: 0;
}

/* Iframe-spezifische Styles für WordPress Betheme Integration */
@media (min-width: 768px) {
    /* Desktop: Full Width */
    body.iframe-mode {
        margin: 0;
        padding: 0;
        background: transparent;
    }
    
    body.iframe-mode .container {
        max-width: none;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    body.iframe-mode .form-content {
        max-width: none;
        width: 100%;
    }
    
    body.iframe-mode .card {
        border-radius: 0;
        box-shadow: none;
        margin: 0;
        padding: 2rem;
    }
    
    body.iframe-mode .progress-container {
        padding: 0 2rem;
    }
    
    body.iframe-mode .form-buttons {
        padding: 0 2rem 2rem 2rem;
    }
}

@media (max-width: 767px) {
    /* Mobile: Normale Breite mit Padding */
    body.iframe-mode .container {
        max-width: 100%;
        padding: 1rem;
        margin: 0;
    }
    
    body.iframe-mode .card {
        border-radius: 0.5rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        margin: 0;
        padding: 1.5rem;
    }
    
    body.iframe-mode .progress-container {
        padding: 0 1rem;
    }
    
    body.iframe-mode .form-buttons {
        padding: 0 1rem 1.5rem 1rem;
    }
}

/* Spezielle Anpassungen für iframe-Einbettung */
body.iframe-mode {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
}

body.iframe-mode h1,
body.iframe-mode h2,
body.iframe-mode h3 {
    font-family: 'Montserrat', sans-serif;
}

/* Entferne Header-Margin für iframe */
body.iframe-mode .text-center.mb-8 {
    margin-bottom: 1rem;
}

/* Optimierte Kachel-Größen für iframe */
body.iframe-mode .kachel-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    align-items: stretch;
    justify-items: stretch;
}

body.iframe-mode .kachel-grid > label {
    min-height: 120px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    box-sizing: border-box;
    flex-grow: 1;
}

/* Responsive Kachel-Grid für iframe */
@media (max-width: 480px) {
    body.iframe-mode .kachel-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Smooth Transitions für iframe */
body.iframe-mode .step {
    transition: all 0.3s ease-in-out;
}

body.iframe-mode .card {
    transition: all 0.3s ease-in-out;
}

/* Optimierte Button-Styles für iframe */
body.iframe-mode .form-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: white;
    border-top: 1px solid #e5e7eb;
}

body.iframe-mode #next-btn,
body.iframe-mode #submit-btn {
    background-color: #f6ae42;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

body.iframe-mode #next-btn:hover,
body.iframe-mode #submit-btn:hover {
    background-color: #e59a2e;
}

body.iframe-mode #prev-btn {
    background-color: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

body.iframe-mode #prev-btn:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

/* Progress Bar Optimierung für iframe */
body.iframe-mode .progress-container {
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid #e5e7eb;
}

@media (max-width: 767px) {
    body.iframe-mode .progress-container {
        padding: 1rem;
    }
}

/* Loading Overlay für iframe */
body.iframe-mode #loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Success Animation für iframe */
body.iframe-mode .success-animation {
    animation: fadeInUp 0.6s ease-out;
}

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