/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors - Purple Theme (matching 1clickautomations.ai) */
    --primary-color: #8B5CF6;
    --primary-dark: #7C3AED;
    --primary-light: #A78BFA;
    --primary-subtle: #EDE9FE;
    
    --text-dark: #1A1A1A;
    --text-medium: #3F3F3F;
    --text-light: #737373;
    
    --bg-main: #FAFAFA;
    --bg-white: #FFFFFF;
    --bg-hover: #F5F3FF;
    
    --border-color: #E5E5E5;
    --success-color: #8B5CF6;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Shadows */
    --shadow-subtle: 0 1px 3px 0 rgba(0, 0, 0, 0.02), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}

body {
    font-family: var(--font-primary);
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 17px;
    background: var(--bg-main);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header - Minimal and clean */
.header {
    background: var(--bg-white);
    padding: 28px 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.header .container {
    max-width: 1200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-medium);
    letter-spacing: -0.3px;
}

.header-brand {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: -0.3px;
}

.brand-underline {
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
}

.brand-underline::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: -2px;
    right: -2px;
    height: 4px;
    background-image: url("data:image/svg+xml,%3Csvg width='100%25' height='4' viewBox='0 0 200 4' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 2.5 Q 10 1, 20 2 T 40 2.5 T 60 2 T 80 2.5 T 100 2 T 120 2.5 T 140 2 T 160 2.5 T 180 2 T 200 2.5' stroke='%238B5CF6' stroke-width='3' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 200px 4px;
    background-position: 0 bottom;
}

/* Main Assessment Area */
.assessment-main {
    padding: 30px 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: auto;
}

.assessment-main .container {
    width: 100%;
    max-width: 1400px;
}

.assessment-wrapper {
    display: flex;
    gap: 32px;
    width: 100%;
    align-items: flex-start;
    justify-content: center;
}

/* Ticker Sidebar */
.assessment-ticker {
    width: 320px;
    flex-shrink: 0;
}

.ticker-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.03) 0%, rgba(255, 255, 255, 1) 100%);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.08);
    position: sticky;
    top: 100px;
}

.ticker-content-assessment {
    position: relative;
    min-height: 200px;
}

.ticker-item-assessment {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.ticker-item-assessment.active {
    opacity: 1;
    transform: translateY(0);
}

.ticker-item-assessment.exiting {
    opacity: 0;
    transform: translateY(-20px);
}

.ticker-icon {
    font-size: 32px;
    margin-bottom: 12px;
    text-align: center;
}

.ticker-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 14px 0;
    text-align: center;
    line-height: 1.3;
}

.ticker-item-assessment p {
    font-size: 14px;
    line-height: 1.7;
    color: #475569;
    margin: 0;
    text-align: center;
    font-weight: 400;
}

/* Progress Bar - Fixed at top */
.progress-container {
    padding: 20px 32px 18px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 100px;
    transition: width 0.5s cubic-bezier(0.65, 0, 0.35, 1);
    width: 0%;
}

.progress-label {
    text-align: left;
    font-size: 14px;
    color: var(--text-medium);
    font-weight: 600;
}

/* Form - Fixed Box Design */
.assessment-form {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    max-height: 1000px;
    min-height: 700px;
    flex: 1;
    max-width: 900px;
}

/* Question Steps - Inside scrollable area */
.question-step {
    display: none;
    opacity: 0;
}

.question-step.active {
    display: block;
    opacity: 1;
    animation: smoothFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Scrollable content area */
.question-content-wrapper {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 36px 40px 28px;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

/* Custom scrollbar */
.question-content-wrapper::-webkit-scrollbar {
    width: 8px;
}

.question-content-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.question-content-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.question-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: #CBD5E1;
}

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

.section-badge {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 18px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.section-badge::before {
    content: '→';
    display: inline-block;
    margin-right: 10px;
    font-size: 16px;
    font-weight: 700;
}

.question-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
    line-height: 1.3;
    letter-spacing: -0.3px;
}

.question-description {
    font-size: 15px;
    color: var(--text-light);
    margin-bottom: 6px;
    line-height: 1.5;
}

.question-content {
    margin-top: 28px;
}

/* Radio Buttons - Smart column layout */
.radio-group {
    display: grid;
    gap: 10px;
}

/* 1-4 options: 1 column */
.radio-group {
    grid-template-columns: 1fr;
}

/* 5-8 options: 2 columns */
.radio-group:has(:nth-child(5)):not(:has(:nth-child(9))) {
    grid-template-columns: repeat(2, 1fr);
}

/* 9-12 options: 3 columns */
.radio-group:has(:nth-child(9)):not(:has(:nth-child(13))) {
    grid-template-columns: repeat(3, 1fr);
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-height: 52px;
}

.radio-option:hover {
    background: var(--bg-hover);
    border-color: var(--primary-light);
    transform: translateX(4px);
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    margin: 0;
    z-index: 10;
}

.radio-option span {
    pointer-events: none;
}

.radio-option:has(input[type="radio"]:checked) {
    background: var(--bg-white);
    border-color: var(--primary-color);
    border-width: 2px;
    padding: 13px 17px; /* Adjust for thicker border */
}

.radio-option span {
    font-size: 17px;
    color: var(--text-dark);
    padding-left: 30px;
    line-height: 1.5;
    font-weight: 400;
    transition: all 0.2s ease;
}

.radio-option input[type="radio"]:checked + span {
    font-weight: 500;
    color: var(--text-dark);
}

/* Custom radio button - Small box style */
.radio-option span::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: white;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.radio-option:hover span::before {
    border-color: var(--primary-light);
}

.radio-option input[type="radio"]:checked + span::before {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Checkmark for selected radio */
.radio-option input[type="radio"]:checked + span::after {
    content: '✓';
    position: absolute;
    left: 21px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 12px;
    font-weight: 700;
    pointer-events: none;
}

/* Checkboxes - Smart column layout */
.checkbox-group {
    display: grid;
    gap: 10px;
}

/* 1-4 options: 1 column */
.checkbox-group {
    grid-template-columns: 1fr;
}

/* 5-8 options: 2 columns */
.checkbox-group:has(:nth-child(5)):not(:has(:nth-child(9))) {
    grid-template-columns: repeat(2, 1fr);
}

/* 9-12 options: 3 columns */
.checkbox-group:has(:nth-child(9)):not(:has(:nth-child(13))) {
    grid-template-columns: repeat(3, 1fr);
}

.checkbox-option {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-height: 52px;
}

.checkbox-option:hover {
    background: var(--bg-hover);
    border-color: var(--primary-light);
    transform: translateX(4px);
}

.checkbox-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-option:has(input[type="checkbox"]:checked) {
    background: var(--bg-white);
    border-color: var(--primary-color);
    border-width: 2px;
    padding: 13px 17px;
}

.checkbox-option span {
    font-size: 17px;
    color: var(--text-dark);
    padding-left: 30px;
    line-height: 1.5;
    font-weight: 400;
    transition: all 0.2s ease;
}

.checkbox-option input[type="checkbox"]:checked + span {
    font-weight: 500;
    color: var(--text-dark);
}

/* Custom checkbox - Small box style */
.checkbox-option span::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: white;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.checkbox-option:hover span::before {
    border-color: var(--primary-light);
}

.checkbox-option input[type="checkbox"]:checked + span::before {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-option input[type="checkbox"]:checked + span::after {
    content: '✓';
    position: absolute;
    left: 21px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.checkbox-option.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.checkbox-option.disabled:hover {
    background: var(--bg-white);
    border-color: var(--border-color);
    transform: none;
}

/* Text Inputs - Clean and minimal */
.text-input {
    width: 100%;
    padding: 16px 0;
    font-size: 22px;
    border: none;
    border-bottom: 3px solid var(--border-color);
    font-family: var(--font-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    color: var(--text-dark);
    font-weight: 600;
    letter-spacing: -0.3px;
}

.text-input:focus {
    outline: none;
    border-bottom-color: var(--primary-color);
}

.text-input::placeholder {
    color: var(--text-light);
    font-weight: 400;
    opacity: 0.6;
}

/* Text Area - Clean and minimal */
.text-area {
    width: 100%;
    padding: 16px 0;
    font-size: 18px;
    border: none;
    border-bottom: 3px solid var(--border-color);
    font-family: var(--font-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
    color: var(--text-dark);
    font-weight: 400;
}

.text-area:focus {
    outline: none;
    border-bottom-color: var(--primary-color);
}

.text-area::placeholder {
    color: var(--text-light);
    opacity: 0.6;
}

/* Other Input */
.other-input {
    width: 100%;
    padding: 14px 18px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-primary);
    margin-top: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-white);
    color: var(--text-dark);
}

.other-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.1);
}

.other-input::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

/* Contact Form Styles */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
}

.field-label .required {
    color: #EF4444;
    font-weight: 700;
}

.field-label .optional {
    color: var(--text-light);
    font-weight: 400;
    font-size: 14px;
}

.field-hint {
    font-size: 13px;
    color: var(--text-light);
    margin-top: -4px;
    margin-bottom: 8px;
    line-height: 1.5;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-primary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-white);
    color: var(--text-dark);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.1);
}

.form-input::placeholder {
    color: var(--text-light);
    opacity: 0.6;
}

.form-textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-primary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-white);
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
    color: var(--text-dark);
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.1);
}

.form-textarea::placeholder {
    color: var(--text-light);
    opacity: 0.6;
}

/* 2-column row for website and phone */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Buttons - Refined design */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 32px;
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    font-family: var(--font-primary);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
    font-weight: 700;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-medium);
    border: none;
    padding: 15px 24px;
}

.btn-secondary:hover {
    color: var(--text-dark);
    background: var(--bg-hover);
}

.btn-submit {
    background: var(--success-color);
    padding: 16px 40px;
    font-size: 17px;
    font-weight: 600;
}

.btn-submit:hover {
    background: #059669;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn:disabled:hover {
    transform: none;
}

/* Form Navigation - Fixed at bottom */
.form-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    background: white;
    border-top: 1px solid var(--border-color);
    gap: 16px;
    flex-shrink: 0;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Key hint - Typeform style */
.key-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-light);
}

.key-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    background: var(--bg-white);
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    line-height: 1;
}

/* Footer - Minimal */
.footer-simple {
    background: transparent;
    color: var(--text-light);
    padding: 32px 0;
    text-align: center;
    font-size: 13px;
}

/* Error States - Subtle */
.question-step.has-error .text-input,
.question-step.has-error .text-area {
    border-bottom-color: #EF4444;
}

/* Loading State */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading.active {
    display: flex;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */

/* Tablets: Max 2 columns */
@media (max-width: 1024px) and (min-width: 769px) {
    .radio-group:has(:nth-child(9)):not(:has(:nth-child(13))),
    .checkbox-group:has(:nth-child(9)):not(:has(:nth-child(13))) {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .assessment-ticker {
        display: none;
    }

    .assessment-wrapper {
        justify-content: center;
    }

    .assessment-form {
        max-width: 900px;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 0 16px;
    }
    
    .assessment-main {
        padding: 20px 0;
    }
    
    .assessment-form {
        height: calc(100vh - 40px);
        max-height: none;
        border-radius: 12px;
    }
    
    .progress-container {
        padding: 20px 24px 16px;
    }
    
    .question-content-wrapper {
        padding: 32px 28px 24px;
    }
    
    .question-title {
        font-size: 24px;
    }
    
    /* Mobile: Always single column */
    .radio-group,
    .checkbox-group {
        grid-template-columns: 1fr !important;
    }
    
    .radio-option,
    .checkbox-option {
        padding: 13px 16px;
        min-height: 48px;
    }
    
    .radio-option:has(input[type="radio"]:checked),
    .checkbox-option:has(input[type="checkbox"]:checked) {
        padding: 12px 15px;
    }
    
    .radio-option span,
    .checkbox-option span {
        font-size: 15px;
        padding-left: 28px;
    }
    
    .radio-option span::before,
    .checkbox-option span::before {
        left: 16px;
        width: 16px;
        height: 16px;
    }
    
    .radio-option input[type="radio"]:checked + span::after,
    .checkbox-option input[type="checkbox"]:checked + span::after {
        left: 19px;
        font-size: 11px;
    }
    
    .text-input {
        font-size: 20px;
        padding: 14px 0;
    }
    
    .text-area {
        font-size: 16px;
        padding: 14px 0;
        min-height: 80px;
    }
    
    .form-navigation {
        flex-direction: column-reverse;
        padding: 20px 24px;
    }
    
    .nav-right {
        width: 100%;
        flex-direction: column;
        gap: 12px;
    }
    
    .btn {
        width: 100%;
    }
    
    .key-hint {
        justify-content: center;
        order: -1;
        margin-bottom: 8px;
    }
    
    /* Contact form - single column on mobile */
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .form-input,
    .form-textarea {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .assessment-main {
        padding: 12px 0;
    }
    
    .container {
        padding: 0 12px;
    }
    
    .assessment-form {
        height: calc(100vh - 24px);
        border-radius: 8px;
    }
    
    .progress-container {
        padding: 16px 20px 14px;
    }
    
    .question-content-wrapper {
        padding: 28px 24px 20px;
    }
    
    .question-title {
        font-size: 22px;
    }
    
    .section-badge {
        font-size: 11px;
        padding: 5px 12px;
        margin-bottom: 14px;
    }
    
    .text-input {
        font-size: 19px;
    }
    
    .text-area {
        font-size: 16px;
    }
    
    .form-navigation {
        padding: 16px 20px;
    }
}

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

/* Selection */
::selection {
    background: var(--primary-subtle);
    color: var(--text-dark);
}

/* Focus styles for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
