/**
 * Plan Wizard Styles - Modern Orange Theme
 * Matching the design from test-wizard reference
 */

/* ======= FONT IMPORTS ======= */
/* Using Avenir font to match site theme */

/* ======= CORE BUTTON STYLES ======= */
.ciw-btn {
    font-family: 'Avenir', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    appearance: none;
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 500;
    cursor: pointer;
    background: #FF5D01;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: transform 0.05s ease, box-shadow 0.2s;
    min-width: 120px;
}

.ciw-btn:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}

.ciw-btn:active {
    transform: translateY(1px);
}

.ciw-btn[disabled],
.ciw-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ciw-btn-secondary {
    background: #2f2f2f;
}

.ciw-btn-secondary:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* ======= OVERLAY + MODAL ======= */
.ciw-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 10000;
}

.ciw-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.ciw-modal {
    position: fixed;
    inset: 0;
    margin: auto;
    max-width: 720px;
    width: 92vw;
    max-height: 88vh;
    background: #fff;
    border-radius: 18px;
    padding: 16px 16px 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    transform: translateY(16px) scale(0.98);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.22s ease, opacity 0.22s ease;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    font-family: 'Avenir', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ciw-modal * {
    box-sizing: border-box;
    font-family: inherit;
}

.ciw-modal.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Close Button */
.ciw-close {
    position: absolute;
    top: 8px;
    right: 12px;
    line-height: 1;
    font-size: 26px;
    background: transparent;
    border: 0;
    color: #666;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 10;
}

.ciw-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* ======= PROGRESS HEADER ======= */
.ciw-progress {
    padding: 12px 12px 4px;
}

.ciw-steps {
    display: flex;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: center;
}

.ciw-steps li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #a3a3a3;
    font-weight: 600;
}

.ciw-steps .dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #f2f2f2;
    border: 2px solid #dcdcdc;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.ciw-steps .active .dot {
    background: #FF5D01;
    border-color: #FF5D01;
    color: #fff;
    transform: scale(1.05);
}

.ciw-steps .bar {
    width: 48px;
    height: 4px;
    background: #e5e5e5;
    border-radius: 2px;
    transition: background 0.3s ease;
}

.ciw-steps .active + .bar {
    background: #ffb899;
}

.ciw-steps .done .bar {
    background: #FF5D01;
}

/* ======= CONTENT AREA ======= */
.ciw-content {
    padding: 10px 14px 6px;
    overflow: auto;
    flex: 1 1 auto;
}

.ciw-title {
    margin: 0 0 6px;
    font-size: 22px;
    color: #222;
    font-weight: 500;
}

.ciw-body {
    font-size: 16px;
    animation: fadeIn 0.3s ease;
    color: #222;
}

.ciw-question {
    font-size: 16px;
    margin-bottom: 12px;
    color: #222;
    font-weight: 600;
}

/* ======= ANSWER OPTIONS GRID ======= */
.ciw-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

@media (max-width: 560px) {
    .ciw-options {
        grid-template-columns: 1fr;
    }
}

.ciw-option {
    border: 2px solid #eaeaea;
    border-radius: 14px;
    padding: 14px;
    cursor: pointer;
    background: #fff;
    text-align: center;
    font-weight: 600;
    font-size: 15px;
    color: #222;
    transition: all 0.2s ease;
    display: inline-block;
}

.ciw-option:hover {
    border-color: #FF5D01;
    background: #fff7f2;
    transform: translateY(-1px);
}

/* ======= FOOTER BUTTONS ======= */
.ciw-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    flex: 0 0 auto;
}

.ciw-spacer {
    flex: 1;
}

/* ======= RESULT CARD ======= */
.ciw-result {
    border: 2px dashed #FF5D01;
    border-radius: 16px;
    padding: 16px;
    margin-top: 8px;
    background: #fff7f2;
    animation: fadeIn 0.3s ease;
}

.ciw-result h3 {
    font-size: 18px;
    color: #FF5D01;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.ciw-result p {
    margin: 0 0 12px 0;
    color: #222;
}

.ciw-result a,
.ciw-result .ciw-btn {
    font-family: 'Avenir', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    padding: 12px 24px;
    background: #FF5D01;
    color: #fff !important;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 93, 1, 0.2);
    transition: all 0.3s ease;
}

.ciw-result a:hover,
.ciw-result .ciw-btn:hover {
    background: #e55201;
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(255, 93, 1, 0.35);
    transform: translateY(-2px);
}

.ciw-result a:active,
.ciw-result .ciw-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 93, 1, 0.2);
}

/* ======= LEGACY CONTAINER STYLES ======= */
.plan-wizard-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: 'Avenir', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.wizard-header h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #222;
    font-size: 28px;
    font-weight: 500;
}

.wizard-progress {
    margin-bottom: 40px;
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF5D01, #ff8030);
    transition: width 0.3s ease;
    width: 0;
}

.progress-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.progress-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e0e0e0;
    transition: background 0.3s ease;
}

.progress-dots .dot.active {
    background: #FF5D01;
}

.wizard-content {
    min-height: 200px;
    margin-bottom: 30px;
}

.wizard-step {
    animation: fadeIn 0.3s ease;
}

.step-question {
    font-size: 24px;
    margin-bottom: 30px;
    text-align: center;
    color: #222;
    font-weight: 500;
}

.step-options {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.wizard-option {
    padding: 20px;
    background: #fff;
    border: 2px solid #eaeaea;
    border-radius: 14px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    color: #222;
}

.wizard-option:hover {
    background: #fff7f2;
    color: #FF5D01;
    border-color: #FF5D01;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 93, 1, 0.15);
}

.wizard-navigation {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.btn-wizard {
    padding: 12px 30px;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.btn-back {
    background: #2f2f2f;
    color: #fff;
}

.btn-back:hover {
    background: #1a1a1a;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}

.btn-reset {
    background: #FF5D01;
    color: #fff;
}

.btn-reset:hover {
    background: #e55201;
    box-shadow: 0 6px 16px rgba(255, 93, 1, 0.3);
}

.btn-primary {
    background: #FF5D01;
    color: #fff !important;
    text-decoration: none;
    display: inline-block;
    padding: 12px 30px;
    border-radius: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #e55201;
    box-shadow: 0 6px 16px rgba(255, 93, 1, 0.3);
    transform: translateY(-2px);
}

.wizard-result {
    text-align: center;
    padding: 40px 20px;
}

.wizard-result h2 {
    color: #FF5D01;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
}

.result-plan {
    background: #fff7f2;
    padding: 30px;
    border-radius: 16px;
    border: 2px dashed #FF5D01;
}

.result-plan h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #222;
    font-weight: 600;
}

.wizard-loading {
    text-align: center;
    padding: 40px;
    color: #757575;
}

.wizard-error {
    text-align: center;
    padding: 40px;
    color: #f44336;
    background: #ffebee;
    border-radius: 6px;
}

/* ======= POPUP STYLES ======= */
.ciw-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ciw-popup-overlay.is-open {
    display: block;
    opacity: 1;
}

.ciw-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #fff;
    padding: 40px;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    z-index: 9999;
    max-width: 500px;
    width: 90%;
    text-align: center;
    opacity: 0;
    transition: all 0.3s ease;
    font-family: 'Avenir', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ciw-popup.is-open {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.ciw-popup h3 {
    margin: 0 0 30px 0;
    font-size: 24px;
    color: #222;
    font-weight: 500;
}

.ciw-popup-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

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

/* ======= RESPONSIVE STYLES ======= */
@media (max-width: 768px) {
    .plan-wizard-container {
        padding: 20px;
        margin: 20px auto;
    }

    .ciw-modal {
        width: 96vw;
        max-height: 92vh;
        border-radius: 12px;
    }

    .ciw-steps {
        gap: 12px;
    }

    .ciw-steps .dot {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }

    .ciw-steps .bar {
        width: 30px;
    }

    .ciw-title {
        font-size: 20px;
    }

    .step-question {
        font-size: 20px;
    }

    .step-options {
        grid-template-columns: 1fr;
    }

    .wizard-option {
        padding: 15px;
    }

    .ciw-popup {
        padding: 30px 20px;
        width: 95%;
        border-radius: 12px;
    }

    .ciw-popup h3 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .ciw-popup-buttons {
        flex-direction: column;
    }

    .ciw-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .ciw-content {
        padding: 8px 10px 4px;
    }

    .ciw-footer {
        padding: 6px 10px;
    }

    .ciw-btn {
        padding: 10px 14px;
        font-size: 14px;
    }

    .wizard-header h1 {
        font-size: 24px;
    }
}
