/* ============================================================
   Home Cinema Companion — styling dei tool (tema v3 "Sala Cinema")
   Legno caldo + ambra: coerente con style.css del tema.
   ============================================================ */

/* ---- card attrezzo: pannello di legno con fascia ambra ---- */
.hcm-tool {
  scroll-margin-top: 90px;
  margin: 2.2rem 0;
  padding: 1.7rem 1.7rem 1.9rem;
  border-radius: 18px;
  border: 1px solid rgba(232, 163, 92, 0.18);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(232, 163, 92, 0.08), transparent 55%),
    rgba(28, 20, 16, 0.72);
  backdrop-filter: blur(6px);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.hcm-tool::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, rgba(232, 163, 92, 0.65), transparent);
  opacity: 0;
  transition: opacity 0.35s;
}
.hcm-tool:hover {
  border-color: rgba(232, 163, 92, 0.38);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.4);
}
.hcm-tool:hover::before { opacity: 1; }

.hcm-tool-head {
  display: flex;
  align-items: flex-start;
  gap: 0.95rem;
  margin-bottom: 1.25rem;
}

/* icona: targa ambra come tasto plancia */
.hcm-tool-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.9rem; height: 2.9rem;
  font-size: 1.35rem;
  line-height: 1;
  border-radius: 13px;
  border: 1px solid rgba(232, 163, 92, 0.35);
  background: rgba(232, 163, 92, 0.09);
  box-shadow: inset 0 1px 0 rgba(232, 163, 92, 0.18);
}

.hcm-tool-title {
  margin: 0 0 0.25rem !important;
  font-size: 1.35rem !important;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #f7efe2;
  font-family: "Fraunces", Georgia, serif;
}

.hcm-tool-desc {
  margin: 0;
  color: #a89880;
  font-size: 0.92rem;
  line-height: 1.55;
}

/* ---- form controls ---- */
*, *::before, *::after { box-sizing: border-box; }

.hcm-input {
  width: 100%;
  padding: 0.68rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(232, 163, 92, 0.28);
  background: rgba(12, 8, 6, 0.75);
  color: #f7efe2;
  font-size: 0.95rem;
  font-family: inherit;
  margin: 0.35rem 0 0.9rem;
  appearance: none;
  -webkit-appearance: none;
}
input[type="number"].hcm-input {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.04em;
}
select.hcm-input {
  margin-top: 0.35rem;
  padding-right: 2.2rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23e8a35c' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
}
option { background: #1c1410; color: #f7efe2; }

.hcm-input:focus {
  outline: none;
  border-color: #e8a35c;
  box-shadow: 0 0 0 3px rgba(232, 163, 92, 0.16);
}

.hcm-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.6rem 1.1rem;
}

.hcm-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.74rem;
  color: #a89880;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-width: 0;
}
.hcm-fields label > .hcm-input { margin-bottom: 0.4rem; }

/* checkbox in tema (wrapper .hcm-check oppure dentro .hcm-fields) */
.hcm-check,
.hcm-fields label:has(> input[type="checkbox"]) {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0.9rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  color: #a89880;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.hcm-check input[type="checkbox"],
.hcm-fields input[type="checkbox"] {
  width: 1.05rem; height: 1.05rem;
  accent-color: #e8a35c;
  margin: 0;
  flex: none;
  cursor: pointer;
}
.hcm-check:hover { color: #d8cab2; }

.hcm-actions { margin-top: 0.4rem; }

.hcm-btn {
  padding: 0.62rem 1.5rem;
  border-radius: 999px;
  border: 1px solid #e8a35c;
  background: rgba(232, 163, 92, 0.12);
  color: #e8a35c;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, box-shadow 0.25s, transform 0.2s;
}

.hcm-btn:hover {
  background: #e8a35c;
  color: #1a0f05;
  box-shadow: 0 6px 24px rgba(232, 163, 92, 0.35);
  transform: translateY(-1px);
}

/* ---- risultati: nastro da sala di proiezione ---- */
.hcm-tool-result {
  margin-top: 1.2rem;
  padding: 1.05rem 1.15rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(232, 163, 92, 0.22);
  background:
    radial-gradient(90% 120% at 0% 0%, rgba(232, 163, 92, 0.07), transparent 60%),
    rgba(12, 8, 6, 0.55);
}

.hcm-tool-result p {
  margin: 0.45rem 0;
  line-height: 1.6;
}
.hcm-tool-result strong {
  color: #e8a35c;
  font-weight: 700;
}

.hcm-hint {
  color: #a89880 !important;
  font-size: 0.85rem !important;
  border-top: 1px dashed rgba(232, 163, 92, 0.2);
  padding-top: 0.65rem;
  margin-top: 0.75rem !important;
}

.hcm-ok { color: #9ed08a !important; }

.hcm-warn {
  color: #ffcf9e !important;
  background: rgba(255, 120, 71, 0.1);
  border-left: 3px solid #ff7847;
  padding: 0.6rem 0.9rem;
  border-radius: 0 10px 10px 0;
}

/* gear list (filtri budget) */
.hcm-gear-list {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.5rem;
}

.hcm-gear-list li {
  padding: 0.6rem 0.9rem;
  border-radius: 11px;
  background: rgba(232, 163, 92, 0.055);
  border: 1px solid rgba(232, 163, 92, 0.16);
  font-size: 0.9rem;
  transition: border-color 0.25s, background 0.25s;
}
.hcm-gear-list li:hover {
  border-color: rgba(232, 163, 92, 0.4);
  background: rgba(232, 163, 92, 0.09);
}
.hcm-gear-list strong { color: #f7efe2; }
.hcm-gear-list em { color: #a89880; font-size: 0.82rem; }

/* tabelle di riferimento */
.hcm-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.8rem;
  font-size: 0.92rem;
}

.hcm-table th,
.hcm-table td {
  text-align: left;
  padding: 0.62rem 0.85rem;
  border-bottom: 1px solid rgba(232, 163, 92, 0.13);
}

.hcm-table thead th {
  color: #e8a35c;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom-color: rgba(232, 163, 92, 0.35);
}

.hcm-table tbody tr { transition: background 0.2s; }
.hcm-table tbody tr:hover { background: rgba(232, 163, 92, 0.05); }

/* disclosure affiliazioni */
.hcm-affiliate-disclosure {
  margin-top: 2.2rem;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  background: rgba(232, 163, 92, 0.05);
  border-left: 3px solid rgba(232, 163, 92, 0.6);
  color: #a89880;
  font-size: 0.85rem;
  line-height: 1.6;
}

.hcm-affiliate-link {
  color: #e8a35c;
  border-bottom: 1px dashed rgba(232, 163, 92, 0.5);
  transition: border-color 0.2s, color 0.2s;
}

.hcm-affiliate-link:hover {
  color: #ff7847;
  border-bottom-style: solid;
}

/* ---- reduced motion: niente transizioni ---- */
@media (prefers-reduced-motion: reduce) {
  .hcm-tool, .hcm-tool::before, .hcm-btn, .hcm-gear-list li, .hcm-table tbody tr, .hcm-affiliate-link {
    transition: none !important;
  }
}

/* ---- mobile: card più strette, niente orridi overflow ---- */
@media (max-width: 640px) {
  .hcm-tool { padding: 1.25rem 1.1rem 1.4rem; border-radius: 14px; }
  .hcm-tool-title { font-size: 1.18rem !important; }
  .hcm-fields { grid-template-columns: 1fr; }
}
