/**
 * Frontend CSS for Dynamic Multistep Forms
 */

/* Import Raleway Font */
@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;700;800&display=swap');

/* Main Form Container */
.dmf-form-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 60px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    font-family: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    position: relative;
    overflow: visible;
    color: #ffffff;
}

/* Progress Bar - New Step Design */
.dmf-progress {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 60px;
    padding: 0 20px;
    position: relative;
}

.dmf-progress-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.dmf-progress-step-indicator {
    width: 100%;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    position: relative;
    margin-bottom: 12px;
}

.dmf-progress-step.active .dmf-progress-step-indicator,
.dmf-progress-step.completed .dmf-progress-step-indicator {
    background-color: #DAFF0A;
}

.dmf-progress-step-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    font-family: 'Raleway', sans-serif;
}

.dmf-progress-step.active .dmf-progress-step-label {
    color: #DAFF0A;
    font-weight: 600;
}

.dmf-progress-step.completed .dmf-progress-step-label {
    color: #ffffff;
}

/* Old progress bar (hidden but kept for compatibility) */
.dmf-progress-bar {
    display: none;
}

.dmf-progress-text {
    display: none;
}

/* Form Content */
.dmf-form-content {
    min-height: 400px;
}

/* Desktop Layout: Two Columns */
@media (min-width: 769px) {
    .dmf-form-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 60px;
        align-items: center;
    }

    .dmf-question-title {
        grid-column: 1;
        grid-row: 1;
        font-size: 56px;
        font-weight: 800;
        color: #ffffff;
        margin-bottom: 40px;
        text-align: left;
        line-height: 1.2;
        font-family: 'Raleway', sans-serif;
    }

    .dmf-step-form {
        grid-column: 2;
        grid-row: 1;
        align-self: center;
    }

    /* Navigation buttons in left column, aligned with options */
    .dmf-form-navigation {
        grid-column: 1;
        grid-row: 1;
        justify-content: flex-start;
        margin-top: auto;
        align-self: end;
        padding-top: 40px;
    }
}

/* Mobile Layout: Cascade */
@media (max-width: 768px) {
    .dmf-question-title {
        font-size: 32px;
        font-weight: 800;
        color: #ffffff;
        margin-bottom: 40px;
        text-align: center;
        line-height: 1.2;
        font-family: 'Raleway', sans-serif;
    }
}

.dmf-question-title {
    font-size: 56px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 50px;
    text-align: center;
    line-height: 1.2;
    font-family: 'Raleway', sans-serif;
}

/* Style for italic words in title (like "tu objetivo") */
.dmf-question-title em,
.dmf-question-title .italic-word {
    font-style: italic;
    font-weight: 400;
}

/* Options Styling */
.dmf-options {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 0;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(139, 0, 139, 0.15) 100%);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Desktop: Options take full width of right column */
@media (min-width: 769px) {
    .dmf-options {
        max-width: 100%;
    }
}

/* Mobile: Center with max-width */
@media (max-width: 768px) {
    .dmf-options {
        max-width: 600px;
    }
}

.dmf-option {
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
}

.dmf-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dmf-option.selected {
    background: rgba(218, 255, 10, 0.1);
}

.dmf-option-content {
    flex: 1;
}

.dmf-option-label {
    margin: 0;
    font-size: 24px;
    font-weight: 400;
    color: #ffffff;
    line-height: 1.4;
    font-family: 'Raleway', sans-serif;
}

.dmf-option-description {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.5;
    display: block;
    margin-top: 4px;
}

/* Multiple Choice Check - New Design */
.dmf-multiple-choice .dmf-option {
    padding-left: 50px;
}

.dmf-multiple-choice .dmf-option::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    transition: all 0.2s ease;
    background: transparent;
}

.dmf-multiple-choice .dmf-option.selected::before {
    background-color: #DAFF0A;
    border-color: #DAFF0A;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"%3e%3cpath fill="%23000" d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"/%3e%3c/svg%3e');
    background-size: 14px 14px;
    background-position: center;
    background-repeat: no-repeat;
}

/* Single Choice Radio - New Design */
.dmf-single-choice .dmf-option {
    padding-left: 50px;
}

.dmf-single-choice .dmf-option::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    transition: all 0.2s ease;
    background: transparent;
}

.dmf-single-choice .dmf-option.selected::before {
    background-color: #DAFF0A;
    border-color: #DAFF0A;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"%3e%3cpath fill="%23000" d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"/%3e%3c/svg%3e');
    background-size: 14px 14px;
    background-position: center;
    background-repeat: no-repeat;
}

/* Input Fields */
.dmf-input-group {
    margin-bottom: 30px;
}

.dmf-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: #ffffff;
}

.dmf-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dmf-input.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.dmf-input-error {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 8px;
    font-weight: 500;
}

/* Avatar Circle - Decorative Element */
.dmf-avatar-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #00B894;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    margin: 30px auto;
}

/* Navigation Buttons - New Design */
.dmf-form-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    padding-top: 0;
    border-top: none;
    gap: 20px;
    position: relative;
}

.dmf-btn {
    padding: 16px 40px;
    border: none;
    border-radius: 32px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    font-family: 'Raleway', sans-serif;
}

.dmf-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.dmf-btn-primary {
    background-color: #555555;
    color: #999999;
    cursor: not-allowed;
}

.dmf-btn-primary.enabled {
    background-color: #FF0066;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 0, 102, 0.4);
}

.dmf-btn-primary.enabled:hover {
    background-color: #E6005C;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 0, 102, 0.5);
}

.dmf-btn-secondary {
    background-color: #3A3A3A;
    color: #999999;
}

.dmf-btn-secondary:hover:not(:disabled) {
    background-color: #4A4A4A;
    color: #CCCCCC;
}

.dmf-btn.loading {
    position: relative;
    color: transparent;
}

.dmf-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: dmf-spin 1s linear infinite;
}

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

/* Error Messages */
.dmf-error-message {
    background-color: #fee;
    color: #e74c3c;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* Completion Page */
.dmf-completion-page {
    text-align: center;
    padding: 40px 0;
}

.dmf-completion-header h2 {
    font-size: 32px;
    color: #333;
    margin-bottom: 16px;
    font-weight: 700;
}

.dmf-completion-header p {
    font-size: 18px;
    color: #666;
    margin-bottom: 40px;
}

.dmf-recommendations {
    display: grid;
    gap: 24px;
    margin-bottom: 40px;
}

.dmf-product-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    transition: all 0.2s ease;
}

.dmf-product-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.dmf-product-image img {
    max-width: 100px;
    height: auto;
    margin-bottom: 20px;
    border-radius: 8px;
}

.dmf-product-name {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
}

.dmf-product-description {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.dmf-product-price {
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 20px;
}

.dmf-product-link {
    display: inline-block;
    text-decoration: none;
}

.dmf-no-recommendations {
    background: #f8f9fa;
    padding: 40px;
    border-radius: 12px;
    color: #666;
    font-size: 18px;
}

.dmf-completion-actions {
    margin-top: 30px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dmf-form-container {
        padding: 30px 20px;
    }

    .dmf-form-content {
        display: block;
    }

    .dmf-progress {
        flex-direction: row;
        padding: 0 10px;
        margin-bottom: 40px;
    }

    .dmf-progress-step-label {
        font-size: 11px;
    }

    .dmf-question-title {
        font-size: 32px !important;
        margin-bottom: 40px !important;
        text-align: center !important;
    }

    .dmf-options {
        padding: 20px 15px;
        max-width: 100%;
    }

    .dmf-option {
        padding: 12px 15px;
    }

    .dmf-option-label {
        font-size: 20px;
    }

    .dmf-form-navigation {
        flex-direction: row;
        gap: 12px;
        margin-top: 30px;
    }

    .dmf-btn {
        min-width: 110px;
        padding: 14px 30px;
        font-size: 15px;
    }

    .dmf-avatar-circle {
        width: 45px;
        height: 45px;
        font-size: 20px;
        margin: 25px auto;
    }

    .dmf-recommendations {
        gap: 16px;
    }

    .dmf-product-card {
        padding: 24px;
    }

    .dmf-product-name {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .dmf-form-container {
        padding: 20px 15px;
    }

    .dmf-form-content {
        display: block;
    }

    .dmf-progress {
        padding: 0 5px;
        margin-bottom: 30px;
    }

    .dmf-progress-step-label {
        font-size: 9px;
    }

    .dmf-question-title {
        font-size: 28px !important;
        margin-bottom: 30px !important;
        text-align: center !important;
    }

    .dmf-options {
        padding: 15px 12px;
    }

    .dmf-option {
        padding: 10px 12px;
    }

    .dmf-option-label {
        font-size: 18px;
    }

    .dmf-input {
        padding: 14px 16px;
    }

    .dmf-btn {
        padding: 12px 25px;
        font-size: 14px;
        min-width: 100px;
    }

    .dmf-avatar-circle {
        width: 40px;
        height: 40px;
        font-size: 18px;
        margin: 20px auto;
    }
}

/* Animations */
.dmf-form-container {
    animation: dmf-fadeIn 0.5s ease;
}

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

.dmf-option {
    animation: dmf-slideIn 0.3s ease forwards;
    opacity: 0;
    transform: translateX(-20px);
}

.dmf-option:nth-child(1) { animation-delay: 0.1s; }
.dmf-option:nth-child(2) { animation-delay: 0.2s; }
.dmf-option:nth-child(3) { animation-delay: 0.3s; }
.dmf-option:nth-child(4) { animation-delay: 0.4s; }
.dmf-option:nth-child(5) { animation-delay: 0.5s; }

@keyframes dmf-slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Elementor Editor Specific */
.dmf-elementor-preview .dmf-option {
    animation: none;
    opacity: 1;
    transform: none;
}

.dmf-editor-notice {
    background: #f1f1f1;
    border: 2px dashed #ccc;
    padding: 40px;
    text-align: center;
    border-radius: 8px;
    color: #666;
}

.dmf-editor-notice p {
    margin: 0 0 16px 0;
    font-size: 16px;
}

.dmf-editor-notice a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.dmf-editor-notice a:hover {
    text-decoration: underline;
}

/* Dark Mode Support - Removed (handled by Elementor background) */

/* Text Only Question Type */
.dmf-text-only-content {
    margin: 20px 0;
}

.dmf-text-content {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
}

.dmf-text-content p {
    margin: 0 0 16px 0;
}

.dmf-text-content p:last-child {
    margin-bottom: 0;
}

.dmf-text-content strong {
    font-weight: 600;
    color: #2c3e50;
}

.dmf-text-content em {
    font-style: italic;
    color: #555;
}

/* Auto-enable next button for text-only questions */
.dmf-text-only-content + .dmf-form-navigation .dmf-next-btn {
    background-color: #667eea;
    cursor: pointer;
}

.dmf-text-only-content + .dmf-form-navigation .dmf-next-btn:hover {
    background-color: #5a6fd8;
}