/* ============================================================
   CCPS Pricing Calculator styles
   All rules scoped under .ccps-calc-root for theme-proof specificity.
   Aesthetic: calm, premium, editorial. Navy + gold + off-white.
   ============================================================ */

.ccps-calc-root {
    --navy: #041632;
    --navy-soft: #0a2349;
    --gold: #c9a84c;
    --gold-deep: #a8842e;
    --offwhite: #f7f5f1;
    --ink: #1d2533;
    --muted: #6a7180;
    --line: #e4e0d6;
    --card: #ffffff;
    --radius: 10px;
    --shadow: 0 10px 40px rgba(4, 22, 50, 0.10);
    --shadow-lift: 0 16px 50px rgba(4, 22, 50, 0.18);

    font-family: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ink);
    background: var(--offwhite);
    padding: clamp(14px, 3vw, 34px);
    width: 100%;
    -webkit-font-smoothing: antialiased;
}

.ccps-calc-root * { box-sizing: border-box; margin: 0; padding: 0; }

.ccps-calc {
    max-width: 880px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ── Progress ──────────────────────────────────────────── */
.ccps-calc-root .ccps-progress {
    padding: 2px 4px 0;
}
.ccps-calc-root .ccps-progress-track {
    background: #e7e3d8;
    height: 5px;
    border-radius: 99px;
    overflow: hidden;
}
.ccps-calc-root .ccps-progress-fill {
    background: linear-gradient(90deg, var(--gold-deep), var(--gold));
    height: 100%;
    width: 0%;
    border-radius: 99px;
    transition: width .4s cubic-bezier(.22,.61,.36,1);
}
.ccps-calc-root .ccps-progress-text {
    margin-top: 9px;
    color: var(--muted);
    font-size: .76rem;
    letter-spacing: .14em;
    text-transform: uppercase;
}

/* ── Card shell ────────────────────────────────────────── */
.ccps-calc-root .ccps-shell {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(22px, 4vw, 44px);
    position: relative;
    overflow: hidden;
}
/* Hairline gold rule across the top of the card. */
.ccps-calc-root .ccps-shell::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--gold-deep));
}

/* ── Steps ─────────────────────────────────────────────── */
.ccps-calc-root .ccps-step { display: none; }
.ccps-calc-root .ccps-step.active { display: block; animation: ccpsFade .4s ease both; }
@keyframes ccpsFade {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ccps-calc-root .ccps-step-header { margin-bottom: 26px; }
.ccps-calc-root .ccps-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--gold-deep);
    font-size: .72rem; letter-spacing: .2em; text-transform: uppercase;
    margin-bottom: 12px; font-weight: 500;
}
.ccps-calc-root .ccps-step-number {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--navy); color: #fff;
    font-size: .8rem; font-weight: 500;
}
.ccps-calc-root .ccps-step-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    color: var(--navy);
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    line-height: 1.12;
    letter-spacing: .005em;
    outline: none;
}
.ccps-calc-root .ccps-step-sub {
    color: var(--muted);
    margin-top: 12px;
    font-size: .95rem;
    line-height: 1.6;
    max-width: 56ch;
    font-weight: 300;
}
.ccps-calc-root .ccps-optional {
    font-family: 'Jost', sans-serif;
    font-size: .58em; font-weight: 400; color: var(--muted);
    letter-spacing: .04em; text-transform: uppercase;
    vertical-align: middle; margin-left: 8px;
}

/* ── Option grid + cards ───────────────────────────────── */
.ccps-calc-root .ccps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
@media (min-width: 520px) { .ccps-calc-root .ccps-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 760px) { .ccps-calc-root .ccps-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 760px) { .ccps-calc-root .ccps-grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 920px) { .ccps-calc-root .ccps-grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }
.ccps-calc-root .ccps-grid.cols-2 { grid-template-columns: 1fr; }
@media (min-width: 520px) { .ccps-calc-root .ccps-grid.cols-2 { grid-template-columns: repeat(2, 1fr); } }

.ccps-calc-root .ccps-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    display: flex; flex-direction: column;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
    -webkit-tap-highlight-color: transparent;
}
.ccps-calc-root .ccps-card:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lift);
}
.ccps-calc-root .ccps-card:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 2px;
}
.ccps-calc-root .ccps-card.selected {
    border-color: var(--gold-deep);
    box-shadow: 0 0 0 2px var(--gold-deep) inset, var(--shadow-lift);
}
.ccps-calc-root .ccps-card.selected .ccps-card-body::after {
    content: "\2713";
    position: absolute; top: 14px; right: 14px;
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--gold-deep); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem;
}

/* Media: real <img> (native lazy-load + alt) or a branded placeholder. */
.ccps-calc-root .ccps-card-media {
    width: 100%; aspect-ratio: 16 / 10;
    object-fit: cover; display: block; background: #eef1f4;
}
.ccps-calc-root .ccps-card-media.placeholder {
    background:
        radial-gradient(120% 120% at 0% 0%, var(--navy-soft) 0%, var(--navy) 60%);
    position: relative;
}
.ccps-calc-root .ccps-card-media.placeholder::after {
    content: "";
    position: absolute; inset: 0;
    background-image: linear-gradient(135deg, transparent 46%, rgba(201,168,76,.5) 47%, rgba(201,168,76,.5) 53%, transparent 54%);
    background-size: 22px 22px;
    opacity: .35;
}
.ccps-calc-root .ccps-card-body {
    padding: 16px 18px;
    position: relative;
    flex: 1;
    display: flex; flex-direction: column; gap: 5px;
}
.ccps-calc-root .ccps-card-pf {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.55rem; font-weight: 600; color: var(--navy);
    line-height: 1; margin-bottom: 2px;
}
.ccps-calc-root .ccps-card-title {
    font-size: 1.02rem; font-weight: 500; color: var(--ink); line-height: 1.3;
    padding-right: 28px;
}
.ccps-calc-root .ccps-card-desc {
    font-size: .85rem; color: var(--muted); line-height: 1.5; font-weight: 300;
}

/* ── Buttons ───────────────────────────────────────────── */
.ccps-calc-root .ccps-actions {
    display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap;
}
.ccps-calc-root .ccps-btn {
    font-family: 'Jost', sans-serif;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 14px 26px;
    font-size: .92rem; font-weight: 500;
    letter-spacing: .06em; text-transform: uppercase;
    cursor: pointer;
    transition: all .2s ease;
    -webkit-tap-highlight-color: transparent;
}
.ccps-calc-root .ccps-btn:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.ccps-calc-root .ccps-btn-primary {
    background: var(--navy); color: #fff; flex: 1; min-width: 150px;
}
.ccps-calc-root .ccps-btn-primary:hover:not(:disabled) { background: var(--navy-soft); transform: translateY(-2px); }
.ccps-calc-root .ccps-btn-secondary {
    background: transparent; color: var(--navy); border-color: var(--line);
}
.ccps-calc-root .ccps-btn-secondary:hover { border-color: var(--navy); }
.ccps-calc-root .ccps-btn:disabled { opacity: .4; cursor: not-allowed; }
.ccps-calc-root .ccps-btn.is-loading { position: relative; color: transparent; }
.ccps-calc-root .ccps-btn.is-loading::after {
    content: ""; position: absolute; top: 50%; left: 50%;
    width: 18px; height: 18px; margin: -9px 0 0 -9px;
    border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
    border-radius: 50%; animation: ccpsSpin .7s linear infinite;
}
@keyframes ccpsSpin { to { transform: rotate(360deg); } }

/* ── Form ──────────────────────────────────────────────── */
.ccps-calc-root .ccps-form-row { display: grid; grid-template-columns: 1fr; gap: 0 18px; }
@media (min-width: 560px) { .ccps-calc-root .ccps-form-row { grid-template-columns: 1fr 1fr; } }
.ccps-calc-root .ccps-field { margin-bottom: 16px; }
.ccps-calc-root .ccps-field label {
    display: block; margin-bottom: 7px;
    font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
    color: var(--navy); font-weight: 500;
}
.ccps-calc-root .ccps-field input,
.ccps-calc-root .ccps-field textarea {
    width: 100%; padding: 13px 14px;
    border: 1px solid var(--line); border-radius: 8px;
    font-size: 16px; font-family: 'Jost', sans-serif; color: var(--ink);
    background: #fff; transition: border-color .2s;
    -webkit-appearance: none;
}
.ccps-calc-root .ccps-field input:focus,
.ccps-calc-root .ccps-field textarea:focus { outline: none; border-color: var(--gold-deep); }
.ccps-calc-root .ccps-field textarea { resize: vertical; min-height: 92px; }
.ccps-calc-root .ccps-field input.ccps-invalid,
.ccps-calc-root .ccps-field textarea.ccps-invalid { border-color: #c0392b; background: #fff8f7; }
.ccps-calc-root .ccps-form-error {
    background: #fdf3f2; border: 1px solid #e7bcb6; color: #9b2c1e;
    padding: 12px 16px; border-radius: 8px; margin-bottom: 16px;
    font-size: .9rem; line-height: 1.5;
}
.ccps-calc-root .ccps-privacy {
    font-size: .78rem; color: var(--muted); margin-top: 14px; line-height: 1.5; font-weight: 300;
}

/* ── Reveal / success ──────────────────────────────────── */
.ccps-calc-root .ccps-reveal { text-align: center; padding: 8px 0 6px; }
.ccps-calc-root .ccps-reveal-eyebrow {
    color: var(--gold-deep); font-size: .74rem; letter-spacing: .22em;
    text-transform: uppercase; margin-bottom: 14px;
}
.ccps-calc-root .ccps-reveal-title {
    font-family: 'Cormorant Garamond', serif; color: var(--navy);
    font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 600; line-height: 1.15; margin-bottom: 22px;
}
.ccps-calc-root .ccps-reveal-box {
    background: linear-gradient(150deg, var(--navy) 0%, var(--navy-soft) 100%);
    border-radius: 12px; padding: 32px 24px; color: #fff;
    position: relative; overflow: hidden;
}
.ccps-calc-root .ccps-reveal-box::after {
    content: ""; position: absolute; right: -40px; top: -40px;
    width: 160px; height: 160px; border-radius: 50%;
    background: radial-gradient(circle, rgba(201,168,76,.28), transparent 70%);
}
.ccps-calc-root .ccps-reveal-label {
    font-size: .76rem; letter-spacing: .18em; text-transform: uppercase;
    color: var(--gold); margin-bottom: 12px;
}
.ccps-calc-root .ccps-reveal-range {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2.1rem, 6vw, 3rem); font-weight: 700; line-height: 1.05;
}
.ccps-calc-root .ccps-reveal-fine {
    font-size: .8rem; color: rgba(255,255,255,.72); margin-top: 14px; line-height: 1.5; font-weight: 300;
}

.ccps-calc-root .ccps-summary {
    margin: 26px auto 0; max-width: 520px; text-align: left;
    border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.ccps-calc-root .ccps-sum-row {
    display: flex; justify-content: space-between; gap: 16px;
    padding: 11px 18px; font-size: .88rem;
    border-bottom: 1px solid var(--line);
}
.ccps-calc-root .ccps-sum-row:last-child { border-bottom: none; }
.ccps-calc-root .ccps-sum-label { color: var(--muted); }
.ccps-calc-root .ccps-sum-value { color: var(--ink); font-weight: 500; text-align: right; }
.ccps-calc-root .ccps-summary-caption {
    text-align: center; font-size: .76rem; letter-spacing: .14em; text-transform: uppercase;
    color: var(--muted); margin: 22px 0 8px;
}

.ccps-calc-root .ccps-next-steps {
    margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line);
}
.ccps-calc-root .ccps-cta-call {
    display: inline-flex; align-items: center; gap: 10px;
    background: var(--gold-deep); color: #fff !important; text-decoration: none;
    padding: 14px 30px; border-radius: 8px;
    font-weight: 500; letter-spacing: .06em; text-transform: uppercase; font-size: .92rem;
    transition: background .2s;
}
.ccps-calc-root .ccps-cta-call:hover { background: var(--gold); }
.ccps-calc-root .ccps-footnote {
    margin-top: 22px; font-size: .74rem; color: var(--muted); line-height: 1.6; font-weight: 300;
}

/* ── Intercept (nothing selected) ──────────────────────── */
.ccps-calc-root .ccps-intercept { text-align: center; padding: 20px 0; }
.ccps-calc-root .ccps-intercept .ccps-step-title { margin-bottom: 14px; }

@media (prefers-reduced-motion: reduce) {
    .ccps-calc-root * { animation: none !important; transition: none !important; }
}

/* ============================================================
   v2: rendered fields, option rows, number inputs, nav
   ============================================================ */

/* Step intro + fields */
.ccps-calc-root .ccps-step-intro {
    color: var(--muted); font-size: .95rem; line-height: 1.6; font-weight: 300;
    max-width: 60ch; margin: -4px 0 22px;
}
.ccps-calc-root .ccps-field { margin: 0 0 26px; }
.ccps-calc-root .ccps-field:last-of-type { margin-bottom: 4px; }
.ccps-calc-root .ccps-field-label {
    font-size: 1.02rem; font-weight: 500; color: var(--navy); margin-bottom: 4px;
}
.ccps-calc-root .ccps-field-hint {
    font-size: .84rem; color: var(--muted); line-height: 1.55; font-weight: 300;
    margin: 0 0 12px; max-width: 64ch;
}

/* Option rows (single-select cards rendered by the engine) */
.ccps-calc-root .ccps-cards {
    display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px;
}
@media (min-width: 600px) { .ccps-calc-root .ccps-cards { grid-template-columns: repeat(2, 1fr); } }

.ccps-calc-root .ccps-cards .ccps-card {
    flex-direction: row; align-items: center; gap: 13px;
    padding: 14px 16px; border-radius: var(--radius);
}
.ccps-calc-root .ccps-cards .ccps-card:hover { transform: translateY(-2px); }
.ccps-calc-root .ccps-card-ph {
    flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid var(--line); background: #fff; transition: all .2s ease;
}
.ccps-calc-root .ccps-cards .ccps-card.selected { transform: none; }
.ccps-calc-root .ccps-cards .ccps-card.selected .ccps-card-ph {
    border-color: var(--gold-deep);
    background: radial-gradient(circle at center, var(--gold-deep) 0 6px, #fff 7px);
    box-shadow: 0 0 0 3px rgba(201,168,76,.18);
}
.ccps-calc-root .ccps-card-label {
    font-size: .95rem; font-weight: 400; color: var(--ink); line-height: 1.4;
}
.ccps-calc-root .ccps-cards .ccps-card.selected .ccps-card-label { font-weight: 500; color: var(--navy); }

/* Service tiles (top-level path picker) keep the editorial banner look */
.ccps-calc-root .ccps-card-service { flex-direction: column; align-items: stretch; gap: 0; }
.ccps-calc-root .ccps-card-service .ccps-card-ph {
    width: 100%; height: 84px; border: 0; border-radius: 0;
    background: radial-gradient(120% 120% at 0% 0%, var(--navy-soft) 0%, var(--navy) 60%);
    position: relative;
}
.ccps-calc-root .ccps-card-service .ccps-card-ph::after {
    content: ""; position: absolute; inset: 0;
    background-image: linear-gradient(135deg, transparent 46%, rgba(201,168,76,.5) 47%, rgba(201,168,76,.5) 53%, transparent 54%);
    background-size: 22px 22px; opacity: .35;
}
.ccps-calc-root .ccps-card-service.selected .ccps-card-ph { box-shadow: none; background: radial-gradient(120% 120% at 0% 0%, var(--navy-soft) 0%, var(--navy) 60%); }

/* Number inputs + steppers */
.ccps-calc-root .ccps-num-wrap { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.ccps-calc-root .ccps-num {
    width: 140px; max-width: 100%; padding: 12px 14px;
    border: 1px solid var(--line); border-radius: var(--radius);
    font-family: inherit; font-size: 1rem; color: var(--ink); background: #fff;
}
.ccps-calc-root .ccps-num:focus { outline: none; border-color: var(--gold-deep); box-shadow: 0 0 0 3px rgba(201,168,76,.16); }
.ccps-calc-root .ccps-step-btn {
    flex: 0 0 auto; width: 42px; height: 42px; border: 1px solid var(--line);
    background: #fff; border-radius: var(--radius); cursor: pointer;
    font-size: 1.3rem; line-height: 1; color: var(--navy);
    display: flex; align-items: center; justify-content: center; transition: all .18s ease;
}
.ccps-calc-root .ccps-step-btn:hover { border-color: var(--gold-deep); color: var(--gold-deep); }
.ccps-calc-root .ccps-step-btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.ccps-calc-root .ccps-num-unit { color: var(--muted); font-size: .9rem; font-weight: 300; }

/* Step navigation row */
.ccps-calc-root .ccps-nav {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-top: 30px; flex-wrap: wrap;
}
.ccps-calc-root .ccps-btn-ghost {
    background: transparent; color: var(--muted); border: 1px solid var(--line);
}
.ccps-calc-root .ccps-btn-ghost:hover { border-color: var(--navy); color: var(--navy); }
