/* --- Tool page shell --- */
.tool-page{
  max-width: 880px;
  margin: 0 auto;
  padding: 20px 24px 50px;
}
.tool-page h1{
  font-weight: 700;
  font-size: clamp(24px, 3vw, 30px);
  margin: 0 0 8px;
  color: var(--ink);
}
.tool-page > p.tool-intro{
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 24px;
}

/* --- Text input --- */
.tool-input{
  width: 100%;
  min-height: 220px;
  padding: 16px 18px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  resize: vertical;
  margin-bottom: 18px;
}
.tool-input:focus{ outline: none; border-color: var(--accent); }

/* --- Stat chips grid --- */
.stats-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}
.stat-chip{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-chip .stat-num{
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}
.stat-chip .stat-label{
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
}

.tool-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- Buttons (shared by all tools) --- */
.btn{
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: border-color .15s ease, background .15s ease, opacity .15s ease, transform .1s ease;
}
.btn:active{ transform: translateY(1px); }
.btn:disabled{ opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary{
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled){ opacity: .88; }
.btn-secondary{
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.btn-secondary:hover:not(:disabled){ border-color: var(--accent); }

/* --- Selector aleatorio --- */
.selector-toolbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: -8px 0 18px;
}
.selector-count{
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-faint);
}
.selector-check{
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}
.selector-check input{ accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

.selector-result{
  min-height: 108px;
  border-radius: 12px;
  border: 1.5px dashed var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px 22px;
  margin-bottom: 18px;
}
.selector-result.has-pick{
  border-style: solid;
  border-color: var(--accent);
}
.selector-result .placeholder{
  font-size: 14px;
  color: var(--ink-faint);
}
.selector-result .pick-text{
  font-weight: 700;
  font-size: clamp(20px, 4vw, 30px);
  color: var(--ink);
  word-break: break-word;
}
.selector-result.spinning .pick-text{
  color: var(--ink-faint);
}

.selector-history{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -6px;
  margin-bottom: 22px;
}
.selector-history .hist-label{
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--ink-faint);
  width: 100%;
  margin-bottom: 2px;
}
.hist-chip{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce){
  .selector-result.spinning .pick-text{ color: var(--ink); }
}

/* --- Generador de contraseñas --- */
.pw-output{
  min-height: 84px;
  border-radius: 12px;
  border: 1.5px solid var(--accent);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px 20px;
  margin-bottom: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(17px, 3.4vw, 24px);
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: break-all;
  user-select: all;
}
.pw-output .placeholder{
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  letter-spacing: 0;
  color: var(--ink-faint);
  word-break: normal;
}
.pw-text{ max-width: 100%; }
.pw-d{ color: var(--accent); }
.pw-s{ color: #B7432F; }
.pw-strength{
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.pw-bar{
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink-faint);
  transition: width .25s ease, background .25s ease;
}
.pw-bar.weak{ background: #B7432F; }
.pw-bar.ok{ background: #B7791F; }
.pw-bar.strong, .pw-bar.vstrong{ background: var(--accent); }
.pw-meta{
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  min-height: 1.4em;
  margin: 8px 0 18px;
}
.pw-status{
  align-self: center;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
}
.pw-controls{
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 700px){ .pw-controls{ grid-template-columns: 1fr 1fr; align-items: start; } }
.pw-length{
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}
.pw-length label, .pw-sets legend{
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--ink-faint);
}
.pw-length input[type=range]{ width: 100%; accent-color: var(--accent); min-width: 0; }
.pw-length input[type=number]{
  width: 72px;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--ink);
}
.pw-length input[type=number]:focus{ outline: none; border-color: var(--accent); }
.pw-sets{ border: 0; margin: 0; padding: 0; display: grid; gap: 9px; }
.pw-sets legend{ padding: 0; margin-bottom: 9px; }
.pw-sets label{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}
.pw-sets input{ accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; flex: none; }
.pw-sets small{ font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--ink-faint); overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce){ .pw-bar{ transition: none; } }

/* --- Formateador de JSON --- */
.jf-code{
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre;
  overflow: auto;
  tab-size: 2;
}
.jf-status{ font-size: 13.5px; font-weight: 600; color: var(--ink-faint); min-height: 1.5em; margin: -6px 0 10px; }
.jf-status.good{ color: var(--accent); }
.jf-status.bad{ color: #B7432F; }
.jf-error{
  margin: 0 0 14px;
  padding: 10px 14px;
  border-left: 3px solid #B7432F;
  border-radius: 4px;
  background: var(--surface);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink);
  overflow-x: auto;
}
.jf-error[hidden], .jf-notes[hidden]{ display: none; }
.jf-options{ display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin: 0 0 16px; }
.jf-options label{ display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-soft); }
.jf-options select{
  padding: 7px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--ink);
}
.jf-options select:focus{ outline: none; border-color: var(--accent); }
.jf-label{ display: block; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-faint); margin-bottom: 6px; }
.jf-outbar{ display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.jf-outbar .selector-count{ flex: 1 1 auto; }
.jf-notes{
  margin: 14px 0 0;
  padding: 10px 14px 10px 32px;
  border-left: 3px solid #B7791F;
  border-radius: 4px;
  background: var(--surface);
  font-size: 13.5px;
  color: #8A5A00;
  max-width: 72ch;
}

/* --- Info section (cómo funciona / cuándo usarlo / FAQ) — shared by all tools --- */
.tool-info{
  margin-top: 48px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.tool-info h2{
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin: 34px 0 12px;
}
.tool-info p,
.tool-info li{
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.tool-info p{ margin: 0 0 12px; max-width: 72ch; }
.tool-info ul{
  margin: 0 0 12px;
  padding-left: 20px;
  max-width: 72ch;
}
.tool-info li{ margin-bottom: 8px; }
.tool-info strong{ color: var(--ink); font-weight: 600; }
.tool-info code{
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--ink);
}

.faq-item{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
  max-width: 72ch;
}
.faq-item summary{
  cursor: pointer;
  list-style: none;
  padding: 14px 44px 14px 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  position: relative;
}
.faq-item summary::-webkit-details-marker{ display: none; }
.faq-item summary::after{
  content: '+';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  color: var(--accent);
}
.faq-item[open] summary::after{ content: '\2212'; }
.faq-item summary:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.faq-item .faq-answer{ padding: 0 18px 6px; }
.faq-item .faq-answer p{ font-size: 14.5px; }
