/* FrogQR - tool-specific styles. Header, hero, footer, base resets, and the
   :root palette tokens come from the shared shell (tool-shell.css); this file
   carries only the generator's form / panels / preview / controls. */

/* ─── Panels (form + preview, side by side on desktop) ───────────────── */

.tool-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 820px) {
  .tool-content { grid-template-columns: 1fr; }
}
/* Ad slots inside .tool-content span both columns so they don't squeeze
   into a single panel track. */
.tool-content > .ad-slot { grid-column: 1 / -1; }

.panel--preview { position: sticky; top: 5.5rem; }
@media (max-width: 820px) {
  .panel--preview { position: static; }
}
.panel__title {
  margin: 0 0 1.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

/* ─── Form fields ──────────────────────────────────────────────────── */

.field { margin-bottom: 1.25rem; }
.field--group {
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem 1.25rem;
  margin: 0 0 1.25rem;
}
.field--group legend {
  padding: 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-light);
}

.field-row {
  display: flex;
  gap: 1rem;
}
.field-row .field { flex: 1; min-width: 0; }
@media (max-width: 460px) {
  .field-row { flex-direction: column; gap: 0; }
}

label, .field__sublabel {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
}
.field__sublabel { margin-top: 1rem; }

textarea, select, input[type="file"] {
  width: 100%;
  padding: 0.7rem 0.85rem;
  background: var(--bg-deep);
  color: var(--text-light);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}
textarea { resize: vertical; min-height: 72px; }
select { cursor: pointer; }
select option { background: var(--bg-deep); color: var(--text-light); }

textarea:focus, select:focus, input[type="file"]:focus,
input[type="color"]:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input[type="file"] { cursor: pointer; padding: 0.55rem 0.7rem; }
input[type="file"]::file-selector-button {
  background: var(--accent);
  color: #07140d;
  border: none;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-right: 0.75rem;
  font-weight: 700;
  font-size: 0.85rem;
}
input[type="file"]::file-selector-button:hover { background: var(--accent-dark); color: #fff; }

.color-field {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
input[type="color"] {
  width: 52px;
  height: 40px;
  padding: 3px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  cursor: pointer;
}
.color-field__hex {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
}

.field__hint {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}
.field__limit { font-style: italic; }
#charCount { font-weight: 700; color: var(--accent); }
#charCount[data-level="warn"] { color: #e0a52b; }
#charCount[data-level="over"] { color: #e5635b; }

.image-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.image-status {
  font-size: 0.82rem;
  color: var(--accent);
  line-height: 1.4;
}
.image-status[hidden] { display: none; }

.notice {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--accent-soft);
  border: 1px solid rgba(25, 195, 125, 0.3);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: rgba(229, 231, 235, 0.92);
}
.notice strong { color: var(--accent); }

/* ─── Preview ──────────────────────────────────────────────────────── */

.qr-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  padding: 1.5rem;
  background: #fff;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}
.qr-preview svg { max-width: 100%; height: auto; display: block; }
.qr-preview:empty {
  background: var(--bg-deep);
  border: 1px dashed var(--border-dark);
}
.qr-preview:empty::after {
  content: 'Your QR code will appear here';
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}

.download-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.download-row .btn { flex: 1 1 auto; min-width: 0; }
@media (max-width: 520px) {
  .download-row { flex-direction: column; }
}
