/* ==========================================================================
   acreNkey Calculator Design System — Global UI Standard
   Master Reference: /calculators/home-affordability-calculator/
   WCAG AAA Certified | Cormorant Garamond + Manrope Typography | 8px Radius
   ========================================================================== */

/* --- 1. DESIGN TOKENS & UTILITIES --- */
:root {
    --calc-wrapper-max-width: 1280px;
    --calc-article-max-width: 1000px;
    --calc-panel-radius: 8px;
    --calc-card-radius: 8px;
    --calc-badge-radius: 4px;
    --calc-border-color: rgba(43, 43, 43, 0.25);
    --calc-input-bg: var(--warm-ivory, #FBF6F3);
    --calc-input-border: var(--divider, #DDD7CF);
    --calc-input-focus: var(--refined-brass, #8C6734);
    --calc-icon-color: var(--refined-brass, #8C6734);
    --calc-icon-size: 20px;
    --calc-spacing-xs: 0.25rem;
    --calc-spacing-sm: 0.5rem;
    --calc-spacing-md: 1rem;
    --calc-spacing-lg: 1.5rem;
    --calc-spacing-xl: 2rem;
}

/* --- 2. MATERIAL SYMBOLS FONT-FACE & BASE CLASS --- */
@font-face {
    font-family: 'Material Symbols Outlined';
    font-style: normal;
    font-weight: 100 700;
    font-display: block;
    src: url('../../style-guide/assets/fonts/kJEhBvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oFsI.woff2') format('woff2'),
         url('https://fonts.gstatic.com/s/materialsymbolsoutlined/v175/kJEhBvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oFsI.woff2') format('woff2');
}

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    overflow: hidden;
    width: 1em;
    height: 1em;
}

/* --- 3. PAGE CONTAINER & BREADCRUMBS --- */
.ak-calc-wrapper {
    max-width: var(--calc-wrapper-max-width);
    margin: 120px auto 0 auto;
    padding: 0 1.5rem;
    font-family: var(--font-body, 'Manrope', sans-serif);
    color: var(--deep-navy, #2F3B42);
    box-sizing: border-box;
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
    flex-wrap: wrap;
}
.page-breadcrumb a {
    color: var(--muted-slate, #64748B);
    text-decoration: none;
    transition: color 0.2s ease;
}
.page-breadcrumb a:hover {
    color: var(--refined-brass, #8C6734);
}
.page-breadcrumb .separator {
    color: #A0AEC0;
}
.page-breadcrumb .current {
    color: var(--deep-navy, #2F3B42);
    font-weight: 600;
}

.ak-calc-header-row {
    margin-bottom: 2rem;
}
.ak-calc-h1 {
    font-family: var(--font-heading, 'Cormorant Garamond', serif);
    font-size: 2.25rem;
    font-weight: 400;
    color: var(--deep-navy, #2F3B42);
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem 0;
}
.ak-calc-sub-text {
    font-size: 0.95rem;
    color: var(--deep-slate, #4A5861);
    max-width: 840px;
    line-height: 1.6;
    margin: 0;
}

/* --- 4. MAIN CALCULATOR GRID --- */
.ak-calc-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: stretch;
    margin-bottom: 2.5rem;
}

/* --- 5. LEFT INPUT PANEL --- */
.ak-calc-left-panel {
    background: #FFFFFF;
    border: 1.5px solid var(--calc-border-color);
    border-radius: var(--calc-panel-radius);
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(13, 27, 36, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ak-panel-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--divider, #DDD7CF);
}
.ak-panel-header h2 {
    font-family: var(--font-heading, 'Cormorant Garamond', serif);
    font-size: 1.35rem;
    color: var(--deep-navy, #2F3B42);
    font-weight: 400;
    margin: 0;
}

/* Input Rows & Labels */
.ak-new-input-row {
    margin-bottom: 1.25rem;
}
.ak-new-input-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}
.ak-new-input-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--deep-navy, #2F3B42);
}
.ak-new-input-label .material-symbols-outlined {
    color: var(--calc-icon-color);
    font-size: var(--calc-icon-size);
}

.ak-new-input-box-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.ak-new-input-box-wrapper .prefix,
.ak-new-input-box-wrapper .suffix {
    position: absolute;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--deep-navy, #2F3B42);
    pointer-events: none;
}
.ak-new-input-box-wrapper .prefix { left: 0.75rem; }
.ak-new-input-box-wrapper .suffix { right: 0.75rem; }

.ak-new-input, .ak-new-select {
    width: 140px;
    height: 38px;
    background: var(--calc-input-bg);
    border: 1px solid var(--calc-input-border);
    border-radius: var(--calc-card-radius);
    font-family: var(--font-body, 'Manrope', sans-serif);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--deep-navy, #2F3B42);
    text-align: right;
    padding: 0 0.75rem;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ak-new-input.has-prefix { padding-left: 1.75rem; }
.ak-new-input.has-suffix { padding-right: 1.75rem; text-align: right; }
.ak-new-input:focus, .ak-new-select:focus {
    outline: none;
    border-color: var(--calc-input-focus);
    box-shadow: 0 0 0 3px rgba(43, 43, 43, 0.15);
}
.ak-new-input.readonly {
    background: #F3F4F6;
    cursor: default;
}

/* Slider Controls */
.ak-new-slider-container {
    position: relative;
    width: 100%;
    height: 24px;
    display: flex;
    align-items: center;
}
.ak-new-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #8C9BB1;
    outline: none;
    cursor: pointer;
    margin: 0;
}
.ak-new-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--refined-brass, #8C6734);
    border: 2px solid #FFFFFF;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.15s ease;
}
.ak-new-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.ak-slider-with-labels {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.ak-slider-labels-inline {
    font-size: 0.75rem;
    color: var(--muted-slate, #64748B);
    font-weight: 500;
    white-space: nowrap;
}

/* Informational Auto-Calculated Box */
.ak-loan-amount-box {
    background: #f8f6f1;
    border: 1px dashed rgba(43, 43, 43, 0.4);
    border-radius: var(--calc-card-radius);
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
}
.ak-la-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ak-la-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--deep-navy, #2F3B42);
    white-space: nowrap;
}
.ak-la-val {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--refined-brass, #8C6734);
}

/* --- 6. RIGHT DARK RESULT PANEL --- */
.ak-calc-right-panel {
    background: var(--deep-navy-100, #2F3B42);
    border-radius: var(--calc-panel-radius);
    padding: 2rem;
    color: #FFFFFF;
    box-shadow: var(--shadow-lux, 0 8px 32px rgba(13, 27, 36, 0.12));
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.ak-right-header {
    font-family: var(--font-heading, 'Cormorant Garamond', serif);
    font-size: 1.25rem;
    color: #FFFFFF;
    font-weight: 400;
}
.ak-indicative-outline {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--calc-badge-radius);
    color: rgba(255, 255, 255, 0.8);
}

.ak-emi-huge {
    font-family: var(--font-heading, 'Cormorant Garamond', serif);
    font-size: clamp(1.75rem, 6vw, 2.5rem);
    line-height: 1.1;
    font-weight: 400;
    color: #9B6248;
    word-break: break-word;
}
.ak-emi-subtext {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
}

.ak-6-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.ak-stat-col {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.ak-stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}
.ak-stat-val {
    font-size: 1rem;
    font-weight: 600;
    color: #FFFFFF;
}

/* Stacked Bar / Progress Component */
.ak-money-goes-section {
    margin-bottom: 1.25rem;
}
.ak-stacked-bar-title-new {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.ak-stacked-bar-new {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    margin-bottom: 0.6rem;
}
.ak-bar-loan-new {
    background: var(--refined-brass, #8C6734);
    height: 100%;
    transition: width 0.3s ease;
}
.ak-bar-down-new {
    background: #4A5861;
    height: 100%;
    transition: width 0.3s ease;
}
.ak-legend-row-new {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.8);
}
.ak-legend-item-inline {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.ak-legend-dot-new {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.ak-legend-dot-new.loan { background: var(--refined-brass, #8C6734); }
.ak-legend-dot-new.down { background: #4A5861; }

/* Dark Insight Box */
.ak-insight-box {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--calc-card-radius);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.83rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.9);
}
.ak-insight-box .material-symbols-outlined {
    color: var(--refined-brass, #8C6734);
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* --- 7. SUPPORTING TIP & EDUCATIONAL CONTENT --- */
.ak-post-widget-unit {
    margin-top: 2rem;
}
.ak-tip-box-new {
    background: #FFFFFF;
    border: 1.5px solid var(--calc-border-color);
    border-radius: var(--calc-card-radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.88rem;
    color: var(--deep-navy, #2F3B42);
    line-height: 1.5;
    margin-bottom: 1rem;
}
.ak-tip-box-new .material-symbols-outlined {
    color: var(--refined-brass, #8C6734);
    font-size: 24px;
    flex-shrink: 0;
}

.ak-calc-article {
    max-width: var(--calc-article-max-width);
    margin: 2.5rem auto 3.5rem auto;
    font-family: var(--font-body, 'Manrope', sans-serif);
    color: var(--deep-navy, #2F3B42);
    line-height: 1.7;
}
.ak-calc-article h2 {
    font-family: var(--font-heading, 'Cormorant Garamond', serif);
    font-size: 1.75rem;
    font-weight: 400;
    margin-top: 3.5rem;
    margin-bottom: 1rem;
    color: var(--deep-navy, #2F3B42);
    letter-spacing: -0.02em;
}
.ak-calc-article h2:first-of-type {
    margin-top: 0;
}
.ak-calc-article p {
    color: var(--deep-slate, #4A5861);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

/* Formula Card Component */
.ak-formula-card {
    background: #FFFFFF;
    border: 1.5px solid rgba(43, 43, 43, 0.2);
    border-radius: var(--calc-card-radius);
    padding: 1.5rem;
    margin: 1.5rem 0 2.5rem 0;
    box-shadow: 0 4px 16px rgba(13, 27, 36, 0.03);
}
.ak-formula-card h3 {
    font-family: var(--font-heading, 'Cormorant Garamond', serif);
    font-size: 1.2rem;
    color: var(--deep-navy, #2F3B42);
    margin: 0 0 1rem 0;
}
.ak-formula-step {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed var(--divider, #DDD7CF);
}
.ak-formula-step:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.ak-formula-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--warm-ivory, #FBF6F3);
    border: 1px solid var(--refined-brass, #8C6734);
    color: var(--dark-brass, #9B6248);
    font-family: var(--font-heading, 'Cormorant Garamond', serif);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}
.ak-formula-content {
    overflow-x: auto;
}
.ak-formula-content strong {
    color: var(--deep-navy, #2F3B42);
    display: block;
    margin-bottom: 0.2rem;
}
.ak-formula-content code {
    font-family: monospace;
    background: #F3F4F6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--highlight-gold, #684A20);
    word-break: break-word;
    white-space: pre-wrap;
}

/* FAQ Accordion Component */
.ak-faq-container {
    margin-top: 2rem;
}
.ak-faq-item {
    border-bottom: 1px solid var(--divider, #DDD7CF);
    padding: 1.25rem 0;
}
.ak-faq-question {
    font-family: var(--font-body, 'Manrope', sans-serif);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--deep-navy, #2F3B42);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
}
.ak-faq-question .material-symbols-outlined {
    transition: transform 0.3s ease;
    color: var(--refined-brass, #8C6734);
}
.ak-faq-item.active .ak-faq-question .material-symbols-outlined {
    transform: rotate(180deg);
}
.ak-faq-answer {
    display: none;
    padding-top: 0.75rem;
    font-size: 0.92rem;
    color: var(--deep-slate, #4A5861);
    line-height: 1.6;
}
.ak-faq-item.active .ak-faq-answer {
    display: block;
}

/* Related Calculators Component */
.ak-more-calcs-section {
    max-width: 1140px;
    margin: 0 auto 2rem auto;
    padding: 3rem 2rem;
}
.ak-more-calcs-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.ak-more-calcs-title {
    font-family: var(--font-heading, 'Cormorant Garamond', serif);
    font-size: 28px;
    font-weight: 400;
    color: var(--deep-navy, #2F3B42);
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem 0;
}
.ak-more-calcs-sub {
    font-size: 0.95rem;
    color: var(--muted-slate, #64748B);
    font-weight: 400;
}
.ak-feature-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.ak-fcard {
    background: #FFFFFF;
    border: 1.5px solid rgba(43, 43, 43, 0.18);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    text-decoration: none;
    color: inherit;
}
.ak-fcard:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(13, 27, 36, 0.08);
    border-color: var(--refined-brass, #8C6734);
}
.ak-fcard-header-flex {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.ak-fcard-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(43, 43, 43, 0.1);
    color: var(--refined-brass, #8C6734);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ak-fcard-title {
    font-family: var(--font-heading, 'Cormorant Garamond', serif);
    font-size: 1.1rem;
    color: var(--deep-navy, #2F3B42);
    font-weight: 500;
    line-height: 1.3;
}
.ak-fcard-desc {
    font-size: 0.85rem;
    color: var(--deep-slate, #4A5861);
    line-height: 1.5;
    margin-bottom: 1.25rem;
}
.ak-fcard-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--refined-brass, #8C6734);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.ak-fcard-link:hover {
    color: var(--highlight-gold, #684A20);
}

/* --- 8. RESPONSIVE BREAKPOINTS --- */
@media (max-width: 991px) {
    .ak-calc-main-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .ak-feature-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ak-calc-wrapper {
        margin: 90px auto 0 auto;
        padding: 0 1rem;
    }
    .ak-calc-h1 {
        font-size: 1.75rem;
    }
    .ak-calc-left-panel, .ak-calc-right-panel {
        padding: 1.25rem;
    }
    .ak-calc-article {
        padding: 0 1rem;
        margin: 1.5rem auto 0 auto;
    }
    .ak-more-calcs-section {
        padding: 1.5rem 1rem 2rem 1rem;
        margin-bottom: 0;
    }
    .ak-calc-article h2,
    .ak-panel-header h2,
    .ak-more-calcs-title {
        margin-top: 2rem;
        margin-bottom: 0.75rem;
        font-size: 20px !important;
    }
    .ak-calc-article h2:first-of-type {
        margin-top: 0;
    }
}

@media (max-width: 580px) {
    .ak-feature-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 500px) {
    .ak-6-stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .ak-stat-col {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        padding-bottom: 0.75rem;
    }
    .ak-stat-col:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
}

@media (max-width: 450px) {
    .ak-new-input, .ak-new-select {
        width: 120px;
        font-size: 0.88rem;
    }
    .ak-new-input-label {
        font-size: 0.82rem;
    }
}
