/* ============================================
   KPR CALCULATOR PAGE CSS
   Extracted from: Homepage/kpr.blade.php
============================================ */

<style>
    * {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    :root {
        --harcourts-navy: #001f49;
        --harcourts-blue: #00aeef;
        --harcourts-dark: #001838;
        --bg-gray: #f8f9fc;
        --bg-light: #ffffff;
        --border-gray: #e3e8ef;
        --text-dark: #1a1f36;
        --text-muted: #697386;
        --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
        --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
        --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
        --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
    }

    body {
        background-color: var(--bg-gray);
        min-height: 100vh;
    }

    /* Main Container */
    .kpr-container {
        max-width: 1140px;
        margin: 0 auto;
        padding: 2rem 1rem 2.5rem;
    }

    /* Card Styles */
    .kpr-card {
        background: white;
        border-radius: 0;
        box-shadow: var(--shadow-sm);
        overflow: hidden;
        transition: all 0.3s ease;
        border: 1px solid var(--border-gray);
    }

    .kpr-card:hover {
        box-shadow: var(--shadow-md);
    }

    /* Result Card */
    .result-card {
        background: linear-gradient(135deg, var(--harcourts-navy) 0%, var(--harcourts-dark) 100%);
        padding: 1.75rem;
        border-radius: 0;
        color: white;
        box-shadow: var(--shadow-sm);
        position: relative;
        overflow: hidden;
        border: 1px solid var(--harcourts-dark);
    }

    .result-card::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(0, 174, 239, 0.15) 0%, transparent 70%);
        pointer-events: none;
    }

    .result-badge {
        display: inline-block;
        background: rgba(0, 174, 239, 0.2);
        border: 1px solid rgba(0, 174, 239, 0.3);
        padding: 0.35rem 0.85rem;
        border-radius: 0;
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        margin-bottom: 1rem;
        color: var(--harcourts-blue);
    }

    .result-value-main {
        font-size: 2.25rem;
        font-weight: 800;
        line-height: 1.1;
        margin: 0.5rem 0 0.25rem;
    }

    .result-subtext {
        font-size: 0.8rem;
        opacity: 0.8;
        margin-bottom: 1.5rem;
        font-weight: 300;
    }

    .result-details {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 0;
        padding: 1.25rem;
        margin-bottom: 1.5rem;
        border: 1px solid rgba(255, 255, 255, 0.15);
    }

    .result-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.65rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .result-row:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .result-row-label {
        font-size: 0.85rem;
        opacity: 0.9;
        font-weight: 500;
    }

    .result-row-value {
        font-size: 0.95rem;
        font-weight: 700;
    }

    /* Input Card */
    .input-card {
        padding: 1.25rem;
    }

    .section-header {
        display: flex;
        align-items: center;
        gap: 0.65rem;
        margin-bottom: 1.25rem;
        padding-bottom: 0.75rem;
        border-bottom: 2px solid var(--bg-gray);
    }

    .section-icon {
        width: 32px;
        height: 32px;
        background: var(--harcourts-blue);
        border-radius: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--text-dark);
        margin: 0;
    }

    /* Form Controls */
    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-label {
        font-weight: 600;
        color: var(--text-dark);
        margin-bottom: 0.5rem;
        font-size: 0.85rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .form-label-badge {
        background: var(--harcourts-blue);
        color: white;
        padding: 0.3rem 0.75rem;
        border-radius: 0;
        font-size: 0.8rem;
        font-weight: 700;
    }

    .input-wrapper {
        position: relative;
    }

    .input-group {
        position: relative;
        display: flex;
        border-radius: 0;
        overflow: hidden;
        box-shadow: none;
        transition: all 0.3s ease;
        border: 2px solid var(--border-gray);
    }

    .input-group:focus-within {
        border-color: var(--harcourts-blue);
        box-shadow: none;
    }

    .input-prefix {
        background: var(--bg-gray);
        padding: 0.65rem 0.85rem;
        border: none;
        border-right: 2px solid var(--border-gray);
        color: var(--text-muted);
        font-weight: 700;
        font-size: 0.85rem;
        display: flex;
        align-items: center;
    }

    .form-control {
        flex: 1;
        border: none;
        padding: 0.65rem 0.85rem;
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--text-dark);
        transition: all 0.3s ease;
    }

    .form-control:focus {
        outline: none;
    }

    select.form-control {
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 0.85rem center;
        padding-right: 2.5rem;
    }

    select.form-control:focus {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2300aeef' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    }

    .input-suffix {
        background: var(--bg-gray);
        padding: 0.65rem 0.85rem;
        border: none;
        border-left: 2px solid var(--border-gray);
        color: var(--text-muted);
        font-weight: 600;
        font-size: 0.8rem;
    }

    /* Range Slider */
    .range-wrapper {
        margin-top: 0.75rem;
    }

    .form-range {
        width: 100%;
        height: 6px;
        border-radius: 0;
        background: linear-gradient(to right, var(--harcourts-blue) 0%, var(--harcourts-blue) 50%, var(--border-gray) 50%, var(--border-gray) 100%);
        outline: none;
        -webkit-appearance: none;
        appearance: none;
    }

    .form-range::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: var(--harcourts-blue);
        border: none;
        cursor: pointer;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
        transition: all 0.2s ease;
    }

    .form-range::-webkit-slider-thumb:hover {
        transform: scale(1.15);
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    }

    .form-range::-moz-range-thumb {
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: var(--harcourts-blue);
        border: none;
        cursor: pointer;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
        transition: all 0.2s ease;
    }

    .range-labels {
        display: flex;
        justify-content: space-between;
        margin-top: 0.4rem;
        font-size: 0.75rem;
        color: var(--text-muted);
    }

    /* Bank Selection */
    .bank-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .bank-card {
        background: white;
        border: 2px solid var(--border-gray);
        border-radius: 0;
        padding: 0.75rem;
        cursor: pointer;
        transition: all 0.2s ease;
        text-align: center;
        position: relative;
        overflow: hidden;
    }

    .bank-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 5px;
        background: var(--harcourts-blue);
        transform: scaleX(0);
        transition: transform 0.3s ease;
    }

    .bank-card:hover {
        border-color: var(--harcourts-blue);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .bank-card:hover::before {
        transform: scaleX(1);
    }

    .bank-card.active {
        background: rgba(0, 174, 239, 0.08);
        border-color: var(--harcourts-blue);
        border-width: 3px;
    }

    .bank-card.active::before {
        transform: scaleX(1);
    }

    .bank-name {
        font-size: 0.8rem;
        font-weight: 700;
        color: var(--text-dark);
        margin-bottom: 0.3rem;
    }

    .bank-rate {
        font-size: 1rem;
        font-weight: 900;
        color: var(--harcourts-blue);
    }

    /* Buttons */
    .btn-action {
        width: 100%;
        padding: 0.9rem 1.5rem;
        border: none;
        border-radius: 0;
        font-weight: 700;
        font-size: 0.9rem;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        text-decoration: none;
    }

    .btn-primary-gradient {
        background: var(--harcourts-blue);
        color: white;
        box-shadow: none;
        border: 3px solid var(--harcourts-blue);
    }

    .btn-primary-gradient:hover {
        background: var(--harcourts-navy);
        border-color: var(--harcourts-navy);
        color: white;
    }

    .btn-secondary-gradient {
        background: white;
        color: var(--harcourts-navy);
        border: 3px solid var(--harcourts-navy);
    }

    .btn-secondary-gradient:hover {
        background: var(--harcourts-navy);
        color: white;
    }

    /* Additional Costs */
    .costs-card {
        background: white;
        border-radius: 0;
        padding: 1.5rem;
        box-shadow: var(--shadow-sm);
        margin-top: 2rem;
        border: 1px solid var(--border-gray);
    }

    .costs-toggle {
        width: 100%;
        background: transparent;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        padding: 0;
        font-weight: 700;
        font-size: 0.95rem;
        color: var(--text-dark);
        transition: color 0.2s ease;
    }

    .costs-toggle:hover {
        color: var(--harcourts-blue);
    }

    .costs-toggle i {
        transition: transform 0.3s ease;
    }

    .costs-toggle[aria-expanded="true"] i {
        transform: rotate(180deg);
    }

    .costs-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 1rem;
        margin-top: 1.25rem;
    }

    .cost-item {
        background: var(--bg-gray);
        padding: 1rem;
        border-radius: 0;
        text-align: center;
        border: 2px solid var(--border-gray);
    }

    .cost-label {
        font-size: 0.75rem;
        color: var(--text-muted);
        font-weight: 600;
        margin-bottom: 0.4rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .cost-value {
        font-size: 0.9rem;
        font-weight: 800;
        color: var(--text-dark);
    }

    /* Modal */
    .modal-content {
        border: 2px solid var(--harcourts-navy);
        border-radius: 0;
        overflow: hidden;
        box-shadow: var(--shadow-md);
    }

    .modal-header {
        background: var(--harcourts-navy);
        color: white;
        padding: 1.25rem 1.5rem;
        border: none;
    }

    .modal-title {
        font-weight: 700;
        font-size: 1.1rem;
    }

    .modal-header .btn-close {
        filter: brightness(0) invert(1);
    }

    .amort-table {
        font-size: 0.85rem;
    }

    .amort-table thead th {
        background: var(--harcourts-navy);
        color: white;
        font-weight: 700;
        padding: 0.75rem;
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 0.5px;
        border: none;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .amort-table tbody td {
        padding: 0.65rem 0.75rem;
        border-bottom: 1px solid var(--border-gray);
    }

    .amort-table tbody tr:hover {
        background-color: rgba(0, 174, 239, 0.05);
    }

    #amortisasiSummary {
        background: linear-gradient(135deg, rgba(0, 31, 73, 0.05) 0%, rgba(0, 174, 239, 0.05) 100%);
    }

    #amortisasiSummary .summary-item {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    #amortisasiSummary .summary-item:last-child {
        border-bottom: none;
        font-weight: 700;
        color: var(--harcourts-navy);
    }

    #amortisasiSummary .summary-label {
        color: var(--text-muted);
        font-size: 0.85rem;
    }

    #amortisasiSummary .summary-value {
        font-weight: 600;
        color: var(--text-dark);
        font-size: 0.9rem;
    }

    .amort-table tbody tr:hover {
        background: var(--bg-gray);
    }

    /* Mobile Responsive */
    @media (max-width: 768px) {
        .kpr-container {
            padding: 1rem 0.75rem 1.5rem;
        }

        .row.g-3 {
            --bs-gutter-y: 1rem;
            --bs-gutter-x: 0.75rem;
        }

        .result-value-main {
            font-size: 1.75rem;
            margin: 0.75rem 0 0.5rem;
        }

        .result-subtext {
            font-size: 0.75rem;
            margin-bottom: 1.25rem;
        }

        .result-details {
            padding: 1rem;
            margin-bottom: 1.25rem;
        }

        .result-row {
            padding: 0.5rem 0;
        }

        .result-row-label {
            font-size: 0.8rem;
        }

        .result-row-value {
            font-size: 0.85rem;
        }

        .bank-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 0.5rem;
            margin-bottom: 0.75rem;
        }

        .input-card, .result-card {
            padding: 1rem;
        }

        .section-title {
            font-size: 0.95rem;
        }

        .section-icon {
            width: 26px;
            height: 26px;
            font-size: 0.85rem;
        }

        .section-header {
            margin-bottom: 1rem;
            padding-bottom: 0.6rem;
            gap: 0.5rem;
        }

        .form-group {
            margin-bottom: 1rem;
        }

        .form-label {
            font-size: 0.8rem;
            margin-bottom: 0.4rem;
        }

        .form-label-badge {
            font-size: 0.75rem;
            padding: 0.25rem 0.6rem;
        }

        .input-group {
            margin-bottom: 0.5rem;
        }

        .input-prefix, .input-suffix {
            padding: 0.6rem 0.7rem;
            font-size: 0.8rem;
        }

        .form-control {
            font-size: 0.85rem;
            padding: 0.6rem 0.7rem;
        }

        select.form-control {
            padding-right: 2rem;
            font-size: 0.85rem;
        }

        .range-wrapper {
            margin-top: 0.5rem;
        }

        .range-labels {
            font-size: 0.7rem;
            margin-top: 0.3rem;
        }

        .costs-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 0.75rem;
        }

        .costs-card {
            padding: 1rem;
            margin-top: 1.25rem;
        }

        .cost-label {
            font-size: 0.75rem;
        }

        .cost-value {
            font-size: 0.9rem;
        }

        .btn-action {
            padding: 0.75rem 1rem;
            font-size: 0.85rem;
            width: 100%;
            margin-top: 0.5rem;
        }

        .btn-action:first-child {
            margin-top: 0;
        }

        .result-badge {
            font-size: 0.65rem;
            padding: 0.3rem 0.7rem;
            margin-bottom: 0.75rem;
        }

        #amortisasiSummary {
            padding: 0.75rem;
        }

        #amortisasiSummary .summary-item {
            padding: 0.4rem 0;
        }

        #amortisasiSummary .summary-label {
            font-size: 0.75rem;
        }

        #amortisasiSummary .summary-value {
            font-size: 0.8rem;
        }
    }

    @media (max-width: 480px) {
        .kpr-container {
            padding: 0.75rem 0.5rem 1.25rem;
        }

        .result-card {
            padding: 0.9rem;
        }

        .input-card {
            padding: 0.9rem;
        }

        .result-value-main {
            font-size: 1.5rem;
        }

        .section-title {
            font-size: 0.9rem;
        }

        .section-icon {
            width: 24px;
            height: 24px;
            font-size: 0.8rem;
        }

        .bank-grid {
            grid-template-columns: 1fr;
            gap: 0.5rem;
        }

        .bank-card {
            padding: 0.65rem;
        }

        .bank-name {
            font-size: 0.75rem;
        }

        .bank-rate {
            font-size: 0.9rem;
        }

        .costs-grid {
            grid-template-columns: 1fr;
            gap: 0.5rem;
        }

        .form-control {
            font-size: 0.8rem;
        }

        .input-prefix, .input-suffix {
            font-size: 0.75rem;
            padding: 0.55rem 0.6rem;
        }

        .form-label {
            font-size: 0.75rem;
        }

        .form-label-badge {
            font-size: 0.7rem;
            padding: 0.2rem 0.5rem;
        }

        .btn-action {
            padding: 0.7rem 0.9rem;
            font-size: 0.8rem;
        }

        .result-row-label {
            font-size: 0.75rem;
        }

        .result-row-value {
            font-size: 0.8rem;
        }

        .cost-label {
            font-size: 0.7rem;
        }

        .cost-value {
            font-size: 0.85rem;
        }

        /* Improve touch targets */
        .form-range {
            height: 8px;
        }

        .form-range::-webkit-slider-thumb {
            width: 22px;
            height: 22px;
        }

        .form-range::-moz-range-thumb {
            width: 22px;
            height: 22px;
        }

        /* Stack columns on very small screens */
        .row.g-3 > [class*="col-"] {
            margin-bottom: 0.75rem;
        }

        /* Modal optimizations */
        .modal-dialog {
            margin: 0.5rem;
        }

        .modal-content {
            border-radius: 0;
        }

        .modal-header {
            padding: 0.75rem 1rem;
        }

        .modal-title {
            font-size: 0.95rem;
        }

        .amort-table {
            font-size: 0.75rem;
        }

        .amort-table thead th {
            padding: 0.5rem 0.4rem;
            font-size: 0.7rem;
        }

        .amort-table tbody td {
            padding: 0.5rem 0.4rem;
            font-size: 0.7rem;
        }

        #btnDownloadPDF {
            font-size: 0.75rem;
            padding: 0.4rem 0.6rem;
        }
    }

    /* Tablet optimizations */
    @media (min-width: 481px) and (max-width: 768px) {
        .kpr-container {
            padding: 1.25rem 1rem 2rem;
        }

        .input-card, .result-card {
            padding: 1.15rem;
        }

        .result-value-main {
            font-size: 1.9rem;
        }

        .form-control {
            font-size: 0.875rem;
        }

        .section-title {
            font-size: 1rem;
        }
    }

    /* Ensure proper stacking on mobile */
    @media (max-width: 991px) {
        .row.g-3 > .col-lg-7,
        .row.g-3 > .col-lg-5 {
            width: 100%;
            max-width: 100%;
        }

        /* Result card should appear after input card on mobile */
        .row.g-3 > .col-lg-5 {
            order: 2;
        }

        .row.g-3 > .col-lg-7 {
            order: 1;
        }
    }

    /* Landscape mobile optimization */
    @media (max-width: 768px) and (orientation: landscape) {
        .kpr-container {
            padding: 0.75rem 0.5rem 1rem;
        }

        .input-card, .result-card {
            padding: 0.85rem;
        }

        .form-group {
            margin-bottom: 0.75rem;
        }

        .result-value-main {
            font-size: 1.6rem;