/**
 * Portfolio Calculator — style.css
 * vault-child/include/portfolio-calculator/style.css
 *
 * Brand: primary #0B74B9 · accent #F27226
 *        headline #000 · body #565656 · light #F5F9FB · border #E3ECF3
 */

/* ── Reset ─────────────────────────────────────────────────────────────────── */
.pfc-wrap *, .pfc-wrap *::before, .pfc-wrap *::after {
    box-sizing: border-box; margin: 0; padding: 0;
}

/* ── Shell ─────────────────────────────────────────────────────────────────── */
.pfc-wrap {
    font-family: 'Inter', sans-serif;
    background: #fff;
    border: 1px solid #E3ECF3;
    border-radius: 16px;
    overflow: hidden;
    max-width: 900px;
    margin: 0 auto;
}

/* ── Header ────────────────────────────────────────────────────────────────── */
.pfc-header {
    padding: 28px 32px 22px;
    border-bottom: 1px solid #E3ECF3;
}
.pfc-eyebrow {
    font-size: 11px; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase;
    color: #F27226; margin-bottom: 6px;
}
.pfc-title    { font-size: 22px; font-weight: 700; color: #000; line-height: 1.25; margin: 0 0 4px; }
.pfc-subtitle { font-size: 13px; color: #565656; }

/* ── Form ──────────────────────────────────────────────────────────────────── */
.pfc-form-area { padding: 24px 32px; border-bottom: 1px solid #E3ECF3; }

/* Date row */
.pfc-date-row {
    display: flex; align-items: flex-end; gap: 10px;
    margin-bottom: 24px;
}
.pfc-date-row .pfc-field { flex: 1; }
.pfc-date-sep { font-size: 14px; color: #aaa; padding-bottom: 11px; flex-shrink: 0; }

.pfc-field      { display: flex; flex-direction: column; gap: 7px; }
.pfc-field--fund   { flex: 1; min-width: 0; }
.pfc-field--amount { width: 180px; flex-shrink: 0; }

.pfc-label {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .08em; color: #565656;
}
.pfc-label--sm { font-size: 10px; }

.pfc-section-label {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .09em; color: #565656;
}

/* Controls */
.pfc-ctrl {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid #E3ECF3; border-radius: 8px;
    font-size: 13px; font-family: 'Inter', sans-serif;
    color: #000; background: #fff;
    transition: border-color .18s, box-shadow .18s;
    -webkit-appearance: none; appearance: none;
}
select.pfc-ctrl {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230B74B9' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 13px center;
    padding-right: 36px; cursor: pointer;
}
.pfc-ctrl:focus {
    outline: none; border-color: #0B74B9;
    box-shadow: 0 0 0 3px rgba(11,116,185,.12);
}

/* Rs. prefix */
.pfc-prefix-wrap { position: relative; }
.pfc-prefix {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    font-size: 12px; font-weight: 600; color: #565656; pointer-events: none;
}
.pfc-prefix-wrap .pfc-ctrl { padding-left: 42px; }

/* Funds header */
.pfc-funds-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
}
.pfc-fund-count { font-size: 11px; color: #aaa; }

/* Fund rows */
.pfc-fund-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }

.pfc-fund-row {
    display: flex; align-items: flex-end; gap: 10px;
    background: #F5F9FB; border: 1px solid #E3ECF3;
    border-radius: 10px; padding: 12px 14px;
    position: relative;
}
.pfc-row-color {
    width: 4px; align-self: stretch; flex-shrink: 0;
    border-radius: 4px; margin-bottom: 0;
}
.pfc-row-fields {
    flex: 1; display: flex; gap: 10px; align-items: flex-end; min-width: 0;
}
.pfc-remove-btn {
    width: 34px; height: 34px; flex-shrink: 0;
    border: 1.5px solid #E3ECF3; border-radius: 8px;
    background: #fff; color: #aaa; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .15s, color .15s, background .15s;
    margin-bottom: 0;
}
.pfc-remove-btn:hover { border-color: #DC2626; color: #DC2626; background: #FEF2F2; }

/* Add fund button */
.pfc-add-btn {
    display: flex; align-items: center; gap: 7px;
    padding: 9px 16px; margin-bottom: 16px;
    border: 1.5px dashed #0B74B9; border-radius: 8px;
    background: transparent; color: #0B74B9;
    font-size: 13px; font-family: 'Inter', sans-serif; font-weight: 600;
    cursor: pointer; width: 100%;
    transition: background .15s;
    justify-content: center;
}
.pfc-add-btn:hover    { background: #F0F7FF; }
.pfc-add-btn:disabled { opacity: .4; cursor: not-allowed; }

/* Calculate button */
.pfc-btn {
    width: 100%;
    background: #F27226; color: #fff;
    border: none; border-radius: 8px; padding: 13px;
    font-size: 14px; font-family: 'Inter', sans-serif; font-weight: 700;
    cursor: pointer; letter-spacing: .02em;
    transition: background .18s, transform .1s;
}
.pfc-btn:hover    { background: #d9621b; }
.pfc-btn:active   { transform: scale(.99); }
.pfc-btn:disabled { opacity: .6; cursor: not-allowed; }

/* Error */
.pfc-error {
    background: #FEF2F2; border: 1px solid #FECACA;
    border-radius: 8px; padding: 10px 14px;
    font-size: 12px; color: #DC2626;
    margin-top: 12px; display: none;
}

/* ── Results ───────────────────────────────────────────────────────────────── */
.pfc-results     { display: none; }
.pfc-results--on { display: block; }

/* KPI row */
.pfc-kpi-row {
    display: grid; grid-template-columns: repeat(3,1fr);
    gap: 1px; background: #E3ECF3;
    border-top: 1px solid #E3ECF3; border-bottom: 1px solid #E3ECF3;
}
.pfc-kpi       { background: #fff; padding: 20px 24px; }
.pfc-kpi--main { background: #F5F9FB; }
.pfc-kpi-label {
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .09em;
    color: #565656; margin-bottom: 8px;
}
.pfc-kpi-val { font-size: 24px; font-weight: 700; color: #000; line-height: 1; }
.pfc-kpi-sub { font-size: 10px; color: #aaa; margin-top: 5px; }

/* Colour utilities */
.pfc-blue    { color: #0B74B9; }
.pfc-pos     { color: #059669; }
.pfc-neg     { color: #DC2626; }

/* Chart */
.pfc-chart-wrap {
    padding: 22px 32px 8px;
    border-bottom: 1px solid #E3ECF3;
}
.pfc-chart-title {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .09em;
    color: #565656; margin-bottom: 12px;
}
#pfc-chart { min-height: 300px; }

/* ── Breakdown table ────────────────────────────────────────────────────────── */
.pfc-breakdown-section {
    padding: 20px 32px;
    border-bottom: 1px solid #E3ECF3;
}
.pfc-breakdown-title {
    font-size: 13px; font-weight: 700; color: #000; margin-bottom: 14px;
}
.pfc-breakdown-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.pfc-breakdown-table {
    width: 100%; border-collapse: collapse;
    font-size: 12px; font-family: 'Inter', sans-serif;
}
.pfc-breakdown-table th {
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em;
    color: #565656; padding: 8px 10px; text-align: left;
    border-bottom: 2px solid #E3ECF3;
    white-space: nowrap;
}
.pfc-th-num { text-align: right; }
.pfc-breakdown-table td {
    padding: 12px 10px; border-bottom: 1px solid #F5F9FB;
    color: #000; vertical-align: middle;
}
.pfc-breakdown-table tbody tr:last-child td { border-bottom: none; }
.pfc-breakdown-table tbody tr:hover td { background: #F5F9FB; }

.pfc-td-num { text-align: right; font-weight: 600; white-space: nowrap; }

.pfc-bd-fund { display: flex; align-items: center; gap: 10px; }
.pfc-bd-dot  {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.pfc-bd-name { font-size: 12px; font-weight: 600; color: #000; line-height: 1.3; }
.pfc-bd-code { font-size: 10px; color: #aaa; margin-top: 1px; }

/* Disclaimer */
.pfc-disclaimer {
    background: #F5F9FB; padding: 14px 32px;
    font-size: 10px; color: #aaa; line-height: 1.65;
}

/* ── Responsive / Mobile ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    /* Padding */
    .pfc-header,
    .pfc-form-area,
    .pfc-chart-wrap,
    .pfc-breakdown-section,
    .pfc-disclaimer { padding-left: 16px; padding-right: 16px; }

    /* Date row: stack */
    .pfc-date-row { flex-direction: column; gap: 12px; }
    .pfc-date-sep { display: none; }
    .pfc-date-row .pfc-field { width: 100%; }

    /* Fund row: stack fields */
    .pfc-fund-row    { flex-wrap: wrap; align-items: stretch; }
    .pfc-row-color   { width: 100%; height: 4px; align-self: auto; border-radius: 4px; margin-bottom: 8px; }
    .pfc-row-fields  { flex-wrap: wrap; width: 100%; }
    .pfc-field--fund   { width: 100%; flex: unset; }
    .pfc-field--amount { width: 100%; flex-shrink: unset; }
    .pfc-remove-btn  { position: absolute; top: 10px; right: 10px; }

    /* KPI: stack */
    .pfc-kpi-row { grid-template-columns: 1fr; }
    .pfc-kpi-val { font-size: 22px; }
    .pfc-title   { font-size: 18px; }

    /* Chart shorter */
    #pfc-chart { min-height: 220px; }
}

@media (min-width: 601px) and (max-width: 860px) {
    .pfc-field--amount { width: 150px; }
}
