/* ==========================================================================
   SuccessBeacon Overseas — Italy tools (finder, funds extras, hub, mock extras)
   Loads after style.css (and dmat.css on the mock-test page).
   ========================================================================== */

/* ---------- Pills (filters) ---------- */
.it-pills { border: 0; display: flex; flex-wrap: wrap; gap: .45rem; min-width: 0; padding: 0; margin: 0; }
.it-pill { position: relative; cursor: pointer; }
.it-pill input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.it-pill span { display: inline-block; padding: .5rem .95rem; border: 1.5px solid var(--line); border-radius: var(--radius-pill); font-size: .9rem; font-weight: 600; color: var(--body); background: var(--white); transition: all .18s; }
.it-pill:hover span { border-color: var(--brand-light); }
.it-pill input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.it-pill input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Scholarship finder ---------- */
.sf-panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: clamp(1.1rem, 2.6vw, 1.75rem); }
.sf-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 1.75rem; }
.sf-filters .it-lab { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); margin-bottom: .45rem; }
.sf-filters select { width: 100%; }
.sf-switch { display: flex; align-items: center; gap: .6rem; font-size: .92rem; font-weight: 600; color: var(--ink); cursor: pointer; margin-top: .2rem; }
.sf-switch input { width: 1.15rem; height: 1.15rem; accent-color: var(--brand); }
.sf-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin: 1.5rem 0 1rem; }
.sf-count { font-weight: 700; color: var(--ink); }
.sf-bar .sf-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.sf-list { display: grid; gap: 1.1rem; }
.sf-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: clamp(1.1rem, 2.6vw, 1.6rem); display: grid; gap: .85rem; transition: box-shadow .25s, border-color .25s; }
.sf-card:hover { box-shadow: var(--shadow); border-color: var(--brand-light); }
.sf-card.is-saved { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(26, 82, 102, .18); }
.sf-card__head { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: flex-start; justify-content: space-between; }
.sf-card h3 { font-size: clamp(1.1rem, 2.4vw, 1.3rem); margin: 0; }
.sf-card__prov { font-size: .88rem; color: var(--muted); margin-top: .15rem; }
.sf-badges { display: flex; flex-wrap: wrap; gap: .4rem; }
.sf-badge { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: .28rem .65rem; border-radius: var(--radius-pill); background: var(--brand-tint); color: var(--brand-dark); }
.sf-badge--merit { background: #fdf1d3; color: #7a5200; }
.sf-badge--ok { background: #dff3e6; color: #1d6b3a; }
.sf-badge--check { background: #fdeed9; color: #8a4b00; }
.sf-badge--india { background: #ece5d7; color: #25498c; }
.sf-amount { font-size: 1rem; color: var(--ink); font-weight: 500; }
.sf-rows { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .85rem 1.5rem; }
.sf-rows div { min-width: 0; }
.sf-rows dt { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); margin-bottom: .15rem; }
.sf-rows dd { margin: 0; font-size: .92rem; color: var(--body); }
.sf-tip { background: var(--surface-sand); border: 1px solid #ecdfc0; border-radius: var(--radius-sm); padding: .65rem .9rem; font-size: .9rem; }
.sf-card__foot { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.sf-save[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.sf-empty { padding: 1.5rem; text-align: center; border: 1.5px dashed var(--line); border-radius: var(--radius-lg); color: var(--body); }
.sf-note { font-size: .86rem; color: var(--body); margin-top: 1.25rem; }
.sf-verified { display: inline-flex; gap: .4rem; align-items: center; font-size: .82rem; font-weight: 600; color: var(--brand-dark); background: var(--brand-tint); padding: .3rem .75rem; border-radius: var(--radius-pill); }

/* ---------- Funds calculator extras ---------- */
.fc-oo { display: grid; gap: .6rem; }
.fc-check { display: flex; gap: .75rem; align-items: flex-start; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); cursor: pointer; }
.fc-check input { width: 1.1rem; height: 1.1rem; margin-top: .2rem; accent-color: var(--brand); flex: none; }
.fc-check b { color: var(--ink); font-size: .92rem; }
.fc-check i { font-style: normal; font-weight: 800; color: var(--brand); margin-left: .35rem; white-space: nowrap; }
.fc-check em { display: block; font-style: normal; font-size: .8rem; color: var(--muted); margin-top: .1rem; }
.fc-bars { list-style: none; margin: 1.25rem 0 .25rem; padding: 0; display: grid; gap: .55rem; }
.fc-bars li { display: grid; grid-template-columns: 7.2rem minmax(0, 1fr) auto; gap: .6rem; align-items: center; font-size: .82rem; color: #d3e6eb; }
.fc-bars i { display: block; height: .55rem; border-radius: 999px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.fc-bars u { display: block; height: 100%; background: var(--accent); border-radius: 999px; text-decoration: none; }
.fc-bars b { color: #fff; font-variant-numeric: tabular-nums; }
.gc-out[data-band="ok"] .gc-out__chip { background: rgba(80, 200, 130, .2); border-color: rgba(140, 230, 175, .5); }
.gc-field-note a { color: inherit; text-decoration: underline; }

/* ---------- Hub ---------- */
.it-hub { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.it-hub .tool-card { height: 100%; }
.it-hub .tool-card__go { align-self: end; }
.it-steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1.1rem; }
.it-steps li { counter-increment: s; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.2rem 1.25rem 1.2rem; box-shadow: var(--shadow-sm); position: relative; }
.it-steps li::before { content: counter(s); display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; margin-bottom: .6rem; }
.it-steps h3 { font-size: 1.05rem; margin-bottom: .3rem; }
.it-steps p { font-size: .92rem; }
.it-callout { background: var(--brand-tint); border: 1px solid #cfe6eb; border-left: 4px solid var(--brand); border-radius: var(--radius); padding: 1rem 1.25rem; color: var(--brand-darker); }
.it-callout--warn { background: var(--surface-sand); border-color: #ecdfc0; border-left-color: var(--accent); color: var(--ink); }
.it-links { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }
.it-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.it-two .it-box { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.25rem 1.4rem; box-shadow: var(--shadow-sm); }
.it-two .it-box h3 { font-size: 1.1rem; margin-bottom: .45rem; }
.it-two .it-box ul { padding-left: 1.1rem; display: grid; gap: .3rem; font-size: .94rem; }

/* ---------- Admission-test mock (extends dmat.css) ---------- */
#italy-mock { min-width: 0; color: var(--body); }
#italy-mock .dm-screen { max-width: 1040px; margin-inline: auto; }
#italy-mock h2, #italy-mock h3, #italy-mock h4 { color: var(--ink); }
#italy-mock [data-focus-h]:focus { outline: none; }
.im-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.im-q { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.1rem, 2.6vw, 1.75rem); box-shadow: var(--shadow-sm); }
.im-q__meta { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center; margin-bottom: .75rem; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.im-q__text { font-size: 1.08rem; color: var(--ink); line-height: 1.6; margin-bottom: 1rem; }
.im-q__text p + p { margin-top: .6rem; }
.im-passage { background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1.1rem; font-size: .96rem; line-height: 1.7; max-height: 22rem; overflow: auto; }
.im-passage p + p { margin-top: .65rem; }
.im-opts { display: grid; gap: .6rem; }
.im-opt { display: flex; gap: .8rem; align-items: flex-start; text-align: left; width: 100%; padding: .8rem 1rem; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--white); font: inherit; color: var(--ink); cursor: pointer; transition: border-color .18s, background .18s; }
.im-opt:hover:not([disabled]) { border-color: var(--brand-light); background: var(--brand-tint); }
.im-opt b { flex: none; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--surface-alt); color: var(--brand-dark); font-size: .85rem; }
.im-opt span { padding-top: .2rem; min-width: 0; overflow-wrap: anywhere; }
.im-opt.is-sel { border-color: var(--brand); background: var(--brand-tint); }
.im-opt.is-sel b { background: var(--brand); color: #fff; }
.im-opt.is-correct { border-color: #2f9e5e; background: #e5f5ec; }
.im-opt.is-correct b { background: #2f9e5e; color: #fff; }
.im-opt.is-wrong { border-color: #d24a4a; background: #fbe9e9; }
.im-opt.is-wrong b { background: #d24a4a; color: #fff; }
.im-opt[disabled] { cursor: default; }
.im-why { margin-top: 1rem; padding: .9rem 1.1rem; border-radius: var(--radius); background: var(--surface-sand); border: 1px solid #ecdfc0; font-size: .94rem; }
.im-svg { max-width: 100%; height: auto; display: block; margin: .25rem 0 1rem; }
.im-score { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9rem; margin: 1.25rem 0; }
.im-score div { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow-sm); }
.im-score b { display: block; font-size: 1.5rem; color: var(--brand); font-variant-numeric: tabular-nums; }
.im-score span { font-size: .8rem; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.im-formula { font-variant-numeric: tabular-nums; }
.im-sec-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.im-sec-tab { border: 1.5px solid var(--line); background: var(--white); border-radius: var(--radius-pill); padding: .4rem .85rem; font: inherit; font-size: .84rem; font-weight: 600; color: var(--body); cursor: pointer; }
.im-sec-tab.is-cur { background: var(--brand); border-color: var(--brand); color: #fff; }
.im-sec-tab small { opacity: .8; font-weight: 500; margin-left: .25rem; }

@media (max-width: 760px) {
  .sf-filters, .sf-rows, .it-hub, .it-two { grid-template-columns: minmax(0, 1fr); }
  .fc-bars li { grid-template-columns: 6rem minmax(0, 1fr) auto; }
}
@media print {
  .sf-actions, .sf-card__foot { display: none; }
}

/* Small helpers shared with the dMAT page (needed when dmat.css is not loaded) */
.dm-link { background: none; border: 0; padding: .25rem .1rem; font: inherit; font-size: .9rem; font-weight: 600; color: var(--brand); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.dm-link:hover { color: var(--brand-dark); }
.dm-copied { font-size: .88rem; color: var(--brand-dark); font-weight: 600; }
.dm-copied.visually-hidden { position: static; width: auto; height: auto; clip: auto; margin: 0; }
.it-table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.it-table th, .it-table td { padding: .6rem .85rem; border-bottom: 1px solid var(--line); text-align: left; }
.it-table th { background: var(--surface-alt); color: var(--ink); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.it-table td:first-child { font-weight: 700; color: var(--ink); white-space: nowrap; }
.it-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.it-table-wrap table { min-width: 460px; }

#italy-mock .dm-mode--primary h3 { color: #fff; }
#italy-mock .dm-mode--primary p { color: #d3e6eb; }
