/* ===== Portfolio ===== */
.portfolio {
    background-color: var(--color-bg-page);
    /* Hero Section */
    .hero-section {
        background: var(--ap-light);
    }

    .hero-content {
        padding-top: 64px;
        padding-bottom: 64px;
        @media (min-width: 1024px) {
            padding-top: 96px;
            padding-bottom: 96px; }
    }

    .hero-text {
        max-width: 700px;
    }

    .hero-badge {
        display: inline-block;
        background: #fff;
        padding: 8px 16px;
        border-radius: 9999px;
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 24px;
    }

    .hero-title {
        font-size: 28px;
        font-weight: 600;
        line-height: 1.25;
        margin-bottom: 16px;
        @media (min-width: 1024px) {
            font-size: 40px;
        }
    }

    .hero-description {
        font-size: 17px;
        color: var(--ap-dark-2);
        line-height: 1.625;
    }

    /* Selector Section */
    .selector-section {
        padding: 64px 24px;
        @media (min-width: 1024px) {
            padding: 96px 50px;
        }
    }

    .selector-container {
        max-width: 1200px;
        margin: 0 auto;
    }

    .selector-warning {
        background: #fff4e5;
        border: 1px solid #f7bc83;
        border-radius: 12px;
        color: var(--ap-dark);
        margin-bottom: 24px;
        padding: 16px 20px;
    }

    /* Step Groups */
    .step-group {
        margin-bottom: 48px;
    }

    #step-0.step-group {
        display: flex;
        flex-direction: column;
        align-items: center;
        .step-header {
            padding: 0;
        }

        .step-title {
            font-size: 30px;
            font-weight: normal
        }

        .icon {
            padding: 32px;
            background-color: var(--color-bg-highlight-secondary);
            border-radius: 8px;
        }

        @media(max-width: 767px) {
            .icon {
                margin-block-end: 32px;
            }

            .step-title {
                text-align: center;
            }
        }

        @media(min-width: 768px) {
            display: grid;
            column-gap: 94px; 
            row-gap: 12px; 
            grid-template-areas: "icon heading" "icon subheading" "icon button"; 
            .icon {
                grid-area: icon;
                align-self: center;
                justify-self: center;
                padding: 64px;
            }
        }
    }

    .step-header {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 24px;
        padding: 4px 8px;
    }

    .step-header-back {
        cursor: pointer;
        user-select: none;
        border-radius: 8px;
        width: fit-content;
    }

    .step-header-back::before {
        content: "";
        width: 40px;
        height: 32px;
        background-image: url("data:image/svg+xml,%0A%3Csvg width='40' height='40' viewBox='0 0 40 40' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M33.75 20L6.25 20' stroke='%23E07829' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M17.5 8.75L6.25 20L17.5 31.25' stroke='%23E07829' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
        background-repeat: no-repeat;
        background-position: center center;
        flex-shrink: 0;
    }

    .step-header-back:hover {
        background: var(--ap-bg);
    }

    .step-header-back:focus-visible {
        outline: 2px solid var(--ap-primary);
        outline-offset: 2px;
    }

    .step-number {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: var(--ap-primary);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        font-weight: 600;
        display: none;
    }

    .step-title {
        font-size: 22px;
        font-weight: 600;
        margin: 0;
    }

    .step-nav {
        display: flex;
        justify-content: flex-end;
        gap: 12px;
        margin-top: 24px;
    }

    .step-nav button: disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    /* Options Grid */
    .options-grid {
        display: grid;
        gap: 16px;
    }

    .options-grid-3 {
        grid-template-columns: 1fr;
        @media (min-width: 768px) {
            grid-template-columns: repeat(3, 1fr);
        }
    }

    /* Option Cards */
    .option-card {
        background-color: #FCFAF7;
        text-align: left;
        padding: 24px;
        border-radius: 16px;
        @media (min-width: 768px) {
            min-height: 274px;
        }

        border: solid 2px transparent;
        transition: all 0.15s;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        &:hover {
            border-color: var(--color-primary);
        }
    }

    .option-card--icon {
        block-size: 48px;
        inline-size: 48px;
        background-color: var(--color-content-attention);
        border-radius: 8px;
        margin-bottom: 24px;
        background-image: url("data:image/svg+xml,%0A%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.5 8L13.5 8' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M9 12.5L13.5 8L9 3.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
        background-repeat: no-repeat;
        background-position: center;
    }

    .option-card-selected {
        border-color: var(--color-content-attention) !important;
    }

    .option-card-center {
        text-align: center;
    }

    .option-name {
        font-weight: 600;
        font-size: 18px;
        margin: 0;
        margin-bottom: 8px;
    }

    .option-year {
        font-weight: 600;
        font-size: 24px;
    }

    .option-description {
        font-size: 14px;
        color: var(--ap-dark-2);
    }

    /* Submit Button */
    .submit-container {
        text-align: center;
    }

    .submit-btn {
        padding: 16px 48px;
        border-radius: 4px;
        font-size: 16px;
        font-weight: 500;
        transition: background-color 0.15s, color 0.15s;
        border: none;
        cursor: pointer;
    }

    .submit-btn-disabled {
        background: #d1d5dc;
        color: #6a7282;
        cursor: not-allowed;
    }

    .submit-btn-enabled {
        background: var(--ap-primary);
        color: var(--ap-dark);
        &:hover {
            background: var(--ap-primary-hover);
        }
    }

    /* Result */
    .summary-card {
        background: var(--ap-card);
        border-radius: 16px;
        padding: 24px;
        margin-bottom: 32px;
        display: flex;
        flex-wrap: wrap;
        gap: 24px;
        align-items: center;
    }

    .summary-label {
        font-size: 12px;
        color: var(--ap-gray);
        text-transform: uppercase;
        letter-spacing: 0.025em;
    }

    .summary-value {
        font-weight: 600;
    }

    .summary-divider {
        width: 1px;
        height: 32px;
        background: var(--ap-light-gray);
    }

    .result-title {
        font-size: 28px;
        font-weight: 600;
        margin-bottom: 8px;
    }

    .result-subtitle {
        color: var(--ap-dark-2);
        margin-bottom: 32px;
    }

    .result-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 48px;
        align-items: center;
        margin-bottom: 48px;
        @media (min-width: 768px) {
            grid-template-columns: 1fr 1fr;
        }
    }

    .chart-container {
        display: flex;
        justify-content: center;
    }

    .pie-chart {
        width: 260px;
        height: 260px;
        border-radius: 50%;
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    }

    .allocations-list {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .allocation-item {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .allocation-item-link {
        text-decoration: none;
        color: inherit;
        border-radius: 8px;
        padding: 8px;
        margin: -8px;
        transition: background-color 0.15s;
        &:hover {
            background-color: var(--ap-bg);
        }
    }

    .allocation-color {
        width: 16px;
        height: 16px;
        border-radius: 2px;
        flex-shrink: 0;
    }

    .allocation-details {
        flex: 1;
    }

    .allocation-header {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
    }

    .allocation-name {
        font-weight: 500;
        font-size: 15px;
    }

    .allocation-percent {
        font-weight: 600;
        font-size: 18px;
        color: var(--ap-primary);
        margin-left: 16px;
    }

    .allocation-bar-bg {
        margin-top: 4px;
        height: 8px;
        background: var(--ap-bg);
        border-radius: 9999px;
        overflow: hidden;
    }

    .allocation-bar {
        height: 100%;
        border-radius: 9999px;
        transition: width 0.5s;
    }

    /* Stats CTA */
    .stats-cta {
        background: var(--ap-card);
        border-radius: 16px;
        padding: 32px;
        margin-bottom: 32px;
        text-align: center;
    }

    .stats-cta-title {
        font-size: 20px;
        font-weight: 600;
        margin-bottom: 8px;
    }

    .stats-cta-text {
        font-size: 15px;
        color: var(--ap-dark-2);
        margin-bottom: 24px;
    }

    /* Disclaimer */
    .disclaimer {
        background: var(--ap-light);
        border-radius: 16px;
        padding: 24px;
        margin-bottom: 32px;
        p {
            font-size: 14px;
            color: var(--ap-dark-2);
        }
    }

    /* Action Buttons */
    .action-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 16px;
        justify-content: center;
    }

    .btn-primary {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 16px 32px;
        border-radius: 4px;
        font-size: 16px;
        font-weight: 500;
        background: var(--ap-primary);
        color: var(--ap-dark);
        transition: background-color 0.15s;
        border: none;
        cursor: pointer;
        text-decoration: none;
        &:hover {
            background: var(--ap-primary-hover);
        }
    }

    .btn-outline {
        display: inline-block;
        padding: 16px 32px;
        border-radius: 4px;
        font-size: 16px;
        font-weight: 500;
        border: 1px solid var(--ap-dark);
        color: var(--ap-dark);
        transition: color 0.15s;
        text-decoration: none;
        &:hover {
            color: var(--ap-primary);
        }
    }

    /* Stats Page */
    .stats-container {
        max-width: 1200px;
        margin: 0 auto;
    }

    .back-link {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-size: 15px;
        font-weight: 500;
        color: var(--ap-dark);
        margin-bottom: 24px;
        transition: color 0.15s;
        text-decoration: none;
        &:hover {
            color: var(--ap-primary);
        }
    }

    .stats-iframe-container {
        border-radius: 16px;
        overflow: hidden;
        border: 1px solid var(--ap-light-gray);
        box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
    }

    .stats-iframe {
        width: 100%;
        border: 0;
        height: 80vh;
    }

    /* ===== Horizon Slider ===== */
    .horizon-slider-container {
        text-align: center;
        padding: 1.5rem 0;
    }

    .horizon-value-display {
        font-size: 2rem;
        font-weight: 700;
        color: black;
        margin-bottom: 1rem;
    }

    .horizon-slider {
        -webkit-appearance: none;
        appearance: none;
        width: 100%;
        height: 8px !important;
        border-radius: 4px;
        background: var(--color-primary) !important;
        outline: none;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        cursor: pointer;
    }

    .horizon-slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: var(--color-primary);
        border: 3px solid #fff;
        box-shadow: 0 1px 4px rgba(0,0,0,0.2);
        cursor: pointer;
    }

    .horizon-slider::-moz-range-thumb {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: var(--color-primary);
        border: 3px solid #fff;
        box-shadow: 0 1px 4px rgba(0,0,0,0.2);
        cursor: pointer;
    }

    .horizon-labels {
        display: flex;
        justify-content: space-between;
        margin: 0.5rem auto 0;
        font-size: 0.85rem;
        color: #888;
    }
}
