/*
  Back to Top Button Generator – Seitenstyles
  Ziel-Pfad im Projekt: webdesign-lernen/back-to-top-button-generator/back-to-top-button-generator.css
  Verwendet ausschliesslich var(--token, Fallback) statt eigener :root-Definitionen,
  damit die echten Design-Tokens aus style.css / webdesign.css nicht ueberschrieben werden.
*/

/* ---------- Formular-Felder ---------- */

.btg-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem 1.5rem;
}

.btg-color-field,
.btg-range-field {
  grid-column: span 1;
}

@media (max-width: 720px) {
  .btg-fields {
    grid-template-columns: 1fr;
  }
}

.btg-fields label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--white);
}

.btg-color-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.btg-color-row input[type="color"] {
  width: 42px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border, #dde3d6);
  border-radius: 8px;
  background: none;
  cursor: pointer;
  flex: 0 0 auto;
}

.btg-range-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.btg-range-row input[type="range"] {
  flex: 1 1 auto;
  accent-color: var(--red, #4c7300);
}

.btg-range-row output {
  min-width: 2.6em;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--mist);
}

/* ---------- Live-Vorschau ---------- */

.btg-preview-aside {
  display: flex;
  flex-direction: column;
}

.btg-preview-box {
  position: relative;
  min-height: 230px;
  margin: 1rem 0 1.25rem;
  border-radius: var(--radius-lg, 16px);
  border: 1px solid rgba(255,255,255,.22);
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.035) 1px, transparent 1px);
  background-size: 20px 20px;
  background-color: rgba(255,255,255,.04);
  overflow: hidden;
}

.btg-live-btn {
  position: absolute;
  right: 30px;
  bottom: 30px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 46px;
  font-family: inherit;
  font-size: 20px;
  line-height: 1;
  padding: 14px 16px;
  border: 0 solid var(--red);
  border-radius: 50px;
  background: var(--red);
  color: var(--white);
  cursor: default;
  box-shadow: 0 12px 26px -12px rgba(0, 0, 0, 0.4);
  transition: background 0.15s ease, color 0.15s ease;
}

.btg-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.btg-secondary {
  background: var(--white, #fff);
  color: var(--red, #4c7300);
  border: 1.5px solid var(--red, #4c7300);
}

.btg-secondary:hover {
  background: var(--red, #4c7300);
  color: var(--white, #fff);
}

/* ---------- Code-Ausgabe ---------- */

.btg-output {
  scroll-margin-top: 90px;
}

.btg-code-block {
  margin-bottom: 1.75rem;
}

.btg-code-block:last-child {
  margin-bottom: 0;
}

.btg-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.btg-code-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.btg-code-hint {
  margin: 0.25rem 0 0.6rem;
  font-size: 0.88rem;
  color: var(--mist);
}

.btg-code-hint code {
  font-size: 0.85em;
}

.btg-copy {
  border: 1px solid var(--red, #4c7300);
  background: var(--white, #fff);
  color: var(--red, #4c7300);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  flex: 0 0 auto;
}

.btg-copy:hover {
  background: var(--red, #4c7300);
  color: var(--white, #fff);
}

.btg-copy.is-copied {
  background: var(--red-deep, #3f6100);
  border-color: var(--red-deep, #3f6100);
  color: var(--white, #fff);
}

.btg-output pre {
  margin: 0;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: var(--black-soft);
  overflow-x: auto;
}

.btg-output code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #e7efe0;
  white-space: pre;
}

/* ---------- Installations-Schritte ---------- */

.btg-steps {
  margin: 0 0 1.25rem;
  padding-left: 1.3rem;
  color: var(--mist);
}

.btg-steps li {
  margin-bottom: 0.55rem;
  line-height: 1.55;
}

.btg-steps li:last-child {
  margin-bottom: 0;
}
