
/* ===========================================================
   CoCreations General Project Calculator - frontend
   All rules are scoped to .ccg-calc.
   =========================================================== */
.ccg-calc {
  --ink:#0f0f0f; --ink-2:#3a3a3a; --ink-3:#6b6b6b; --ink-4:#9b9b9b;
  --line:#e7e3da; --line-2:#efece5;
  --soft:#fbf9f4; --soft-2:#f6f3ec;
  --accent:#d4a017; --accent-2:#f6c100; --accent-soft:#f9efbf;
  --shadow-sm:0 4px 14px rgba(20,20,20,.05);
  --shadow-md:0 18px 40px rgba(20,20,20,.08);
  --shadow-lg:0 30px 80px rgba(20,20,20,.12);
  --ease:cubic-bezier(.2,.7,.2,1);
  font-family:'Urbanist', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink); font-size:16px; line-height:1.5;
  max-width: 880px; margin: 0 auto; padding: 0 16px;
}
.ccg-calc, .ccg-calc *, .ccg-calc *::before, .ccg-calc *::after { box-sizing: border-box; }
.ccg-calc h1, .ccg-calc h2, .ccg-calc h3, .ccg-calc h4 { font-family:'Urbanist',sans-serif; color: var(--ink); margin:0; letter-spacing:-0.012em; font-weight:700; }

.ccg-calc-shell { background:#fff; border:1px solid var(--line); border-radius:22px; box-shadow: var(--shadow-lg); overflow: hidden; }
.ccg-calc-head { padding:32px 36px 6px; }
.ccg-calc-eyebrow { font-size:11px; letter-spacing:.22em; text-transform:uppercase; color: var(--accent); font-weight:700; }
.ccg-calc-title { font-size: clamp(1.6rem, 3.2vw, 2.1rem); margin:8px 0 6px; letter-spacing:-0.018em; line-height:1.1; }
.ccg-calc-sub { color: var(--ink-3); font-size: 15px; margin:0 0 4px; }

.ccg-calc-progress { height:5px; background: var(--line-2); margin: 18px 0 0; }
.ccg-calc-progress-bar { height:100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width:0; transition: width .55s var(--ease); }

.ccg-calc-step-meta { padding:18px 36px 4px; display:flex; justify-content:space-between; align-items:center; font-size: 12px; color: var(--ink-2); }
.ccg-calc-step-meta .ccg-calc-eyebrow { color: var(--ink-3); }
.ccg-calc-step-name { font-weight:600; color: var(--ink); font-size:13px; letter-spacing:.04em; text-transform: uppercase; }
.ccg-calc-step-of { color: var(--ink-3); }

.ccg-calc-body { padding: 18px 36px 28px; min-height: 380px; position: relative; }

.ccg-calc-step { animation: ccgIn .45s var(--ease); }
.ccg-calc-q { font-family:'Urbanist',sans-serif; font-size: clamp(1.25rem, 2.2vw, 1.55rem); font-weight:600; line-height:1.2; margin: 0 0 6px; letter-spacing:-0.01em; }
.ccg-calc-q-sub { color: var(--ink-3); font-size:14px; margin: 0 0 18px; }

.ccg-calc-options { display:grid; grid-template-columns: 1fr; gap: 10px; }
.ccg-calc-options.two { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 620px) { .ccg-calc-options.two { grid-template-columns: 1fr; } }
.ccg-calc-option { display:flex; align-items:center; gap:12px; padding:13px 16px; border:1.5px solid var(--line); border-radius:12px; cursor:pointer; transition: all .22s var(--ease); background:#fff; position:relative; }
.ccg-calc-option:hover { border-color: var(--ink-4); background: var(--soft); }
.ccg-calc-option .dot { width:18px; height:18px; min-width:18px; border-radius:50%; border:2px solid var(--ink-4); position:relative; transition: all .25s var(--ease); }
.ccg-calc-option .dot::after { content:""; position:absolute; inset:3px; border-radius:50%; background: var(--accent); transform: scale(0); transition: transform .25s var(--ease); }
.ccg-calc-option .label { font-size: 15px; font-weight: 500; color: var(--ink); line-height:1.3; }
.ccg-calc-option .label small { display:block; color: var(--ink-3); font-size: 12.3px; font-weight: 400; margin-top: 2px; line-height: 1.4; }
.ccg-calc-option.selected { border-color: var(--ink); background:#fff; box-shadow: 0 8px 18px rgba(0,0,0,.06); }
.ccg-calc-option.selected .dot { border-color: var(--ink); }
.ccg-calc-option.selected .dot::after { transform: scale(1); }
.ccg-calc-option.check .dot { border-radius: 5px; }
.ccg-calc-option.check.selected .dot { background: var(--ink); border-color: var(--ink); }
.ccg-calc-option.check.selected .dot::after { background:#fff; inset:5px; transform: scale(1); border-radius: 2px; }

.ccg-calc-tiles-group { margin-bottom: 18px; }
.ccg-calc-tiles-group .ttl { font-weight: 500; font-size: 13px; color: var(--ink); margin-bottom:8px; display:block; }
.ccg-calc-tiles { display:flex; gap:8px; flex-wrap:wrap; }
.ccg-calc-tile { min-width: 52px; height: 46px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 10px; background:#fff; font-family: inherit; font-weight:500; font-size: 14px; color: var(--ink); transition: all .22s ease; cursor:pointer; }
.ccg-calc-tile:hover { border-color: var(--ink-4); }
.ccg-calc-tile.selected { background: var(--ink); border-color: var(--ink); color:#fff; }

.ccg-calc-tiers { display:grid; grid-template-columns: repeat(3, 1fr); gap:12px; }
.ccg-calc-tiers.two { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 760px) { .ccg-calc-tiers, .ccg-calc-tiers.two { grid-template-columns: 1fr; } }
.ccg-calc-tier { border:1.5px solid var(--line); border-radius:14px; padding:22px 18px; cursor:pointer; transition: all .28s var(--ease); background:#fff; text-align:left; font-family: inherit; }
.ccg-calc-tier:hover { border-color: var(--ink-4); transform: translateY(-2px); }
.ccg-calc-tier .name { font-family:'Urbanist',sans-serif; font-weight:700; font-size:18px; margin-bottom:4px; color: var(--ink); }
.ccg-calc-tier .desc { font-size:13px; color: var(--ink-3); line-height:1.45; margin:0; }
.ccg-calc-tier .price { color: var(--ink-3); font-size:12px; margin-top:8px; }
.ccg-calc-tier.selected { border-color: var(--ink); box-shadow: 0 14px 28px rgba(0,0,0,.08); background: linear-gradient(180deg,#fff,var(--soft)); }

.ccg-calc-input-group { display:grid; grid-template-columns: 1fr 1fr; gap:14px; margin-bottom:14px; }
.ccg-calc-input-group.full { grid-template-columns: 1fr; }
@media (max-width: 620px) { .ccg-calc-input-group { grid-template-columns: 1fr; } }
.ccg-calc-input label { display:block; font-weight:500; font-size:12px; color: var(--ink-2); margin-bottom:6px; letter-spacing:.04em; text-transform: uppercase; }
.ccg-calc-input input, .ccg-calc-input select { width:100%; padding: 13px 14px; border:1.5px solid var(--line); border-radius: 11px; font-family: inherit; font-size:15px; background:#fff; color: var(--ink); transition: border-color .2s ease, box-shadow .2s ease; }
.ccg-calc-input input:focus, .ccg-calc-input select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(0,0,0,.05); }

.ccg-calc-slider-wrap { background: var(--soft); border-radius: 16px; padding: 18px 20px; }
.ccg-calc-slider-value { font-family:'Urbanist',sans-serif; font-weight: 700; font-size: 34px; letter-spacing: -0.02em; }
.ccg-calc-slider-value small { font-weight:500; color: var(--ink-3); font-size: 14px; margin-left:6px; }
.ccg-calc-slider { width:100%; -webkit-appearance: none; appearance: none; height:6px; background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--ccg-pct, 0%), var(--line-2) var(--ccg-pct, 0%), var(--line-2) 100%); border-radius:999px; outline:none; margin: 14px 0 8px; }
.ccg-calc-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height:24px; border-radius:50%; background: var(--ink); cursor:pointer; box-shadow: 0 4px 10px rgba(0,0,0,.18); }
.ccg-calc-slider::-moz-range-thumb { width:24px; height:24px; border-radius:50%; background: var(--ink); cursor:pointer; border:none; box-shadow: 0 4px 10px rgba(0,0,0,.18); }
.ccg-calc-slider-meta { display:flex; justify-content:space-between; color: var(--ink-3); font-size:12px; font-weight:500; }

.ccg-calc-outdoor-sf { margin-top: 10px; display:none; align-items:center; gap:10px; }
.ccg-calc-option.selected .ccg-calc-outdoor-sf { display:flex; }
.ccg-calc-outdoor-sf input { width: 110px; padding: 8px 10px; border:1.5px solid var(--line); border-radius:8px; font-size:14px; font-family:inherit; }
.ccg-calc-outdoor-sf .hint { color: var(--ink-3); font-size: 12px; }

.ccg-calc-pool-sub { margin-top: 14px; padding: 14px 16px; background: var(--soft); border-radius:12px; display:none; }
.ccg-calc-pool-sub.show { display:block; }
.ccg-calc-pool-sub h4 { font-size: 13px; font-weight: 600; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-2); }

.ccg-calc .ccg-calc-nav { width: 100%; box-sizing: border-box; padding: 22px 36px 30px; border-top: 1px solid var(--line-2); display:flex; justify-content: space-between; align-items: center; gap: 12px; background: #fff; }
.ccg-calc .ccg-calc-head, .ccg-calc .ccg-calc-body, .ccg-calc .ccg-calc-step-meta { width: 100%; box-sizing: border-box; }
.ccg-calc-back { background: transparent; border: none; padding: 12px 8px; color: var(--ink-3); font-family: inherit; font-size: 14px; cursor: pointer; transition: color .2s ease; }
.ccg-calc-back:hover { color: var(--ink); }
.ccg-calc-back:disabled { opacity: 0.35; cursor: not-allowed; }
.ccg-calc-next { background: var(--ink); color:#fff; border:none; padding: 14px 28px; border-radius: 999px; font-family: inherit; font-weight: 600; font-size: 15px; display:inline-flex; align-items:center; gap:10px; transition: all .2s ease; cursor:pointer; }
.ccg-calc-next:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(0,0,0,.18); background: #1a1a1a; }
.ccg-calc-next:disabled { background: var(--ink-4); cursor: not-allowed; transform: none; box-shadow: none; }

.ccg-calc-note { background: var(--soft-2); border-left: 3px solid var(--accent); padding: 14px 18px; border-radius: 0 12px 12px 0; margin: 14px 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; }

.ccg-calc-result { padding: 40px 36px; text-align: center; animation: ccgIn .6s ease; }
.ccg-calc-result .ribbon { display:inline-block; background: var(--accent-soft); color: #8a6800; padding: 6px 14px; border-radius:999px; font-size:11px; letter-spacing:.18em; text-transform: uppercase; font-weight:700; margin-bottom: 16px; }
.ccg-calc-result .estimate-title { font-size: clamp(1.6rem, 3vw, 2rem); margin-bottom: 4px; font-weight: 700; letter-spacing: -0.012em; }
.ccg-calc-result .estimate-sub { color: var(--ink-3); font-size: 14px; margin-bottom: 18px; }
.ccg-calc-result .ccg-calc-result-msg { font-size: clamp(1.05rem, 2.2vw, 1.3rem); font-weight: 600; color: var(--ink); max-width: 560px; margin: 20px auto 6px; line-height: 1.5; }
.ccg-calc-blurb { color: var(--ink-2); font-size: 15px; line-height: 1.6; margin-top: 22px; }
.ccg-calc-result .ccg-calc-offer { max-width: 560px; margin: 24px auto 0; padding: 18px 22px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 14px; color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.55; }
.ccg-calc-result .cta-row { margin-top: 22px; display: inline-flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.ccg-calc-result .cta-row a { display:inline-flex; padding:14px 26px; background: var(--ink); color:#fff; border-radius:999px; font-weight:600; text-decoration:none; transition: all .2s ease; }
.ccg-calc-result .cta-row a:hover { background:#1a1a1a; transform:translateY(-1px); box-shadow: 0 12px 24px rgba(0,0,0,.2); }

.ccg-calc-gate { padding: 12px 0 6px; }
.ccg-calc-gate h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.ccg-calc-gate p { color: var(--ink-3); font-size: 14px; margin: 0 0 14px; }
.ccg-calc-gate .hp { position:absolute; left:-9999px; opacity:0; }
.ccg-calc-err { color:#a12b2b; font-size:13px; margin-top:10px; min-height:18px; }

@keyframes ccgIn { from { opacity: 0; transform: translateY(12px); } to { opacity:1; transform: translateY(0); } }

/* Keyboard focus + reduced motion. */
.ccg-calc :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  .ccg-calc *, .ccg-calc *::before, .ccg-calc *::after { animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; }
  .ccg-calc-progress-bar { transition:none !important; }
}

/* Selection feedback. */
.ccg-calc-option, .ccg-calc-tile, .ccg-calc-tier { will-change: border-color, background, box-shadow; }
.ccg-calc-option.advancing { border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.ccg-calc-tier.advancing   { border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
@media (prefers-reduced-motion: reduce) {
  .ccg-calc-option.advancing, .ccg-calc-tier.advancing { box-shadow: none; }
}

/* Area picker. */
.ccg-calc-options.areas { grid-template-columns: repeat(3, 1fr); gap: 9px; }
.ccg-calc-options.areas .ccg-calc-option { padding: 12px 14px; gap: 10px; }
.ccg-calc-options.areas .ccg-calc-option .label { font-size: 14.5px; }
.ccg-calc-options.areas .ccg-calc-option .dot { width: 16px; height: 16px; min-width: 16px; }
.ccg-calc-options.areas .ccg-calc-option.wide {
  grid-column: 1 / -1; margin-top: 6px; border-style: dashed; background: var(--soft);
}
.ccg-calc-options.areas .ccg-calc-option.wide.selected { border-style: solid; background: #fff; }
@media (max-width: 760px) { .ccg-calc-options.areas { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 430px) { .ccg-calc-options.areas { grid-template-columns: 1fr; } }

/* Shown only if the script never runs. */
.ccg-calc-fallback { padding: 40px 0; color: var(--ink-3); font-size: 15px; line-height: 1.6; }
.ccg-calc-fallback p { margin: 0 0 10px; }
.ccg-calc-fallback strong { color: var(--ink); }
.ccg-calc-fallback a { color: var(--ink); text-decoration: underline; }
