/* Free tool pages. Layered on /site.css (tokens, nav, band, footer). */

.tool { max-width: 820px; margin: -64px auto 0; padding: 0 20px; position: relative; z-index: 2; display: grid; gap: 20px; }

.card { background: var(--white); border-radius: 28px; padding: 30px; box-shadow: var(--shadow); }
.card-title { font-size: 15px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ocean); margin-bottom: 14px; }
.field { margin-bottom: 18px; }
.field label, .legend { display: block; font-size: 17px; font-weight: 700; color: var(--depth); margin-bottom: 8px; }
.legend { padding: 0; }
.hint { font-size: 16px; line-height: 1.5; color: var(--mid); margin-top: 8px; }
.hint a { color: var(--ocean); font-weight: 700; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }

.input, .select {
  width: 100%; min-height: 56px; padding: 12px 16px; font-size: 19px; font-weight: 600; color: var(--ink);
  background: var(--bg); border: 2px solid var(--line); border-radius: 14px; transition: border-color .15s, background .15s;
}
.input:hover, .select:hover { border-color: #C2D6DE; }
.input:focus, .select:focus { outline: none; border-color: var(--ocean); background: var(--white); box-shadow: 0 0 0 4px rgba(11,119,153,.15); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230B7799' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 44px; }

.choices { border: 0; margin: 0 0 22px; padding: 0; min-width: 0; }
.choice-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
#diameter-field:not([hidden]) { grid-column: 1 / -1; }
.choice {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  min-height: 112px; padding: 14px 10px; border: 2px solid var(--line); border-radius: 18px; background: var(--white);
  font-size: 16px; font-weight: 700; color: var(--depth); cursor: pointer; transition: border-color .15s, background .15s, transform .15s;
}
.choice:hover { transform: translateY(-2px); border-color: #C2D6DE; }
.choice::before { content: ''; width: 56px; height: 36px; border: 3px solid var(--ocean); background: var(--mist); }
.choice:has(input[value="rectangle"])::before { border-radius: 6px; }
.choice:has(input[value="round"])::before { width: 40px; height: 40px; border-radius: 50%; }
.choice:has(input[value="oval"])::before { border-radius: 50%; }
.choice:has(input[value="kidney"])::before { width: 64px; height: 40px; border: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 40'%3E%3Cpath d='M10 6c8-3 14 4 20 9s12 5 18 0 13-4 14 4c1 12-12 19-28 19S2 31 2 21C2 13 5 8 10 6z' fill='%23EAF6FA' stroke='%230B7799' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.choice:has(input:checked) { border-color: var(--ocean); background: var(--mist); box-shadow: 0 0 0 4px rgba(11,119,153,.12); }
.choice:has(input:checked)::after { content: '✓'; position: absolute; top: 8px; right: 10px; width: 24px; height: 24px; border-radius: 50%; background: var(--ocean); color: var(--white); font-size: 14px; display: grid; place-items: center; }
.choice:focus-within { outline: 3px solid var(--sun); outline-offset: 3px; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.btn-calc {
  display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 60px; margin-top: 6px;
  border: 0; border-radius: 16px; font: 700 19px/1.2 var(--font); color: var(--white); background: var(--grad);
  box-shadow: 0 10px 24px rgba(8,94,120,.28); transition: transform .15s ease, box-shadow .15s ease;
}
.btn-calc:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(8,94,120,.35); }

.result {
  margin-top: 20px; background: var(--grad-hero); color: var(--white); border-radius: 22px; padding: 24px 26px;
  animation: pop .35s cubic-bezier(.2,.9,.3,1.3);
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.result-amount { font-size: clamp(34px, 6vw, 48px); font-weight: 800; letter-spacing: -1.4px; line-height: 1.1; }
.result-detail { margin-top: 8px; font-size: 18px; line-height: 1.5; color: rgba(255,255,255,.93); }
.result a { color: var(--sun); font-weight: 800; text-underline-offset: 3px; display: inline-flex; min-height: 44px; align-items: center; }
.problem { margin-top: 18px; background: var(--amber-bg); color: var(--amber); border-radius: 16px; padding: 14px 18px; font-size: 17px; font-weight: 600; }

.explain, .trial, .related { border-radius: 24px; padding: 28px 30px; }
.explain { background: var(--white); border: 1px solid var(--line); }
.explain h2, .trial h2, .related h2 { font-size: 26px; font-weight: 800; letter-spacing: -.6px; color: var(--depth); margin-bottom: 12px; line-height: 1.2; }
.explain p { color: var(--ink); margin-bottom: 12px; }
.safety { position: relative; margin-top: 6px; padding: 16px 18px 16px 50px; background: var(--amber-bg); color: var(--amber); border-radius: 16px; font-weight: 600; }
.safety::before { content: '⚠'; position: absolute; left: 18px; top: 15px; font-size: 20px; line-height: 1.3; }
.related { background: var(--mist); }
.related a { display: flex; align-items: center; gap: 14px; background: var(--white); border-radius: 18px; padding: 18px; text-decoration: none; min-height: 72px; color: var(--depth); font-weight: 800; font-size: 19px; transition: transform .15s, box-shadow .15s; }
.related a:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.related a span { font-weight: 500; color: var(--mid); font-size: 16px; display: block; }
.related a .arrow { margin-left: auto; color: var(--ocean); font-size: 24px; }
.trial { background: var(--grad-hero); color: var(--white); text-align: center; }
.trial h2 { color: var(--white); }
.trial p { color: rgba(255,255,255,.92); max-width: 560px; margin: 0 auto 20px; }
.btn-cta { min-height: 56px; padding: 14px 28px; border-radius: 14px; border: 0; font: 700 18px/1.2 var(--font); background: var(--sun); color: var(--abyss); box-shadow: 0 10px 24px rgba(255,209,102,.35); transition: transform .15s; }
.btn-cta:hover { transform: translateY(-2px); }

@media (max-width: 640px) {
  .card { padding: 22px 18px; border-radius: 24px; }
  .fields { grid-template-columns: 1fr; }
  .choice-grid { grid-template-columns: 1fr 1fr; }
  #diameter-field:not([hidden]) { grid-column: auto; }
  .explain, .trial, .related { padding: 24px 20px; }
}
