/* ===================================
   VARIABLES & RESET
   =================================== */
:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #818cf8;
  --accent: #7c3aed;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --error: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* ===================================
   HEADER
   =================================== */
header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  padding: 14px 0;
  box-shadow: 0 2px 8px rgb(79 70 229 / 0.3);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

header nav a {
  color: rgb(255 255 255 / 0.85);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

header nav a:hover {
  color: #fff;
}

/* ===================================
   AD SLOTS
   =================================== */
.ad-container {
  text-align: center;
}

.ad-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.ad-top {
  padding: 16px 0 8px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
}

.ad-below-result {
  margin-top: 24px;
  padding: 16px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}

.ad-sidebar {
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  padding: 12px;
}

.sticky-ad {
  position: sticky;
  top: 20px;
}

/* ===================================
   MAIN LAYOUT
   =================================== */
main {
  padding: 32px 16px 48px;
}

/* ===================================
   HERO
   =================================== */
.hero {
  text-align: center;
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 10px;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 560px;
  margin: 0 auto;
}

/* ===================================
   TOOL LAYOUT (CARD + SIDEBAR)
   =================================== */
.tool-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 48px;
}

@media (min-width: 1024px) {
  .tool-layout {
    grid-template-columns: 1fr 320px;
    align-items: start;
  }
}

/* ===================================
   TOOL CARD
   =================================== */
.tool-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  border: 1px solid var(--border);
}

/* ===================================
   FORM FIELDS
   =================================== */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.field textarea,
.field select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  resize: vertical;
}

.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(79 70 229 / 0.12);
  background: #fff;
}

.field select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.char-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 4px;
}

/* ===================================
   COLOR FIELD
   =================================== */
.color-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.color-field:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(79 70 229 / 0.12);
}

.color-field input[type="color"] {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  background: none;
  appearance: none;
  -webkit-appearance: none;
}

.color-field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 6px;
}

.color-field input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}

.color-field span {
  font-size: 0.875rem;
  font-family: 'Courier New', monospace;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===================================
   OPTIONS GRID
   =================================== */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

@media (min-width: 480px) {
  .options-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
  }
}

/* ===================================
   GENERATE BUTTON
   =================================== */
.btn-generate {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 4px 12px rgb(79 70 229 / 0.35);
  margin-bottom: 8px;
}

.btn-generate:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgb(79 70 229 / 0.45);
}

.btn-generate:active {
  transform: translateY(0);
  opacity: 0.92;
}

/* ===================================
   ERROR MESSAGE
   =================================== */
.error-msg {
  display: none;
  background: #fef2f2;
  color: var(--error);
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 8px;
}

/* ===================================
   OUTPUT AREA
   =================================== */
.output-area {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-height: 200px;
}

.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 200px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.875rem;
}

#qr-output {
  display: flex;
  justify-content: center;
}

#qr-output canvas,
#qr-output img {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  max-width: 100%;
  height: auto;
}

/* ===================================
   DOWNLOAD BUTTON
   =================================== */
.btn-download {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 28px;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 4px 12px rgb(16 185 129 / 0.3);
}

.btn-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgb(16 185 129 / 0.4);
}

.btn-download:active {
  transform: translateY(0);
  opacity: 0.92;
}

/* ===================================
   SIDEBAR
   =================================== */
.sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .sidebar {
    display: block;
  }
}

/* ===================================
   CONTENT SECTIONS
   =================================== */
.content-section {
  margin-bottom: 48px;
}

.content-section h2 {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

/* ===================================
   STEPS (CÓMO FUNCIONA)
   =================================== */
.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.step h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.step p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===================================
   BENEFITS LIST
   =================================== */
.benefits-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.benefits-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9375rem;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.benefits-list li svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.benefits-list li strong {
  color: var(--text);
}

/* ===================================
   FAQ
   =================================== */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-list details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.faq-list details[open] {
  box-shadow: var(--shadow);
}

.faq-list summary {
  padding: 16px 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: '+';
  font-size: 1.25rem;
  color: var(--primary);
  font-weight: 300;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.faq-list details[open] summary::after {
  transform: rotate(45deg);
}

.faq-list details p {
  padding: 0 20px 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
  border-top: 1px solid var(--border);
  margin-top: 0;
  padding-top: 14px;
}

.faq-list details code {
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.8125rem;
  color: var(--primary);
}

/* ===================================
   FOOTER
   =================================== */
footer {
  background: var(--text);
  color: rgb(255 255 255 / 0.7);
  padding: 24px 0;
  text-align: center;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

footer a {
  color: var(--primary-light);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.footer-disclaimer {
  font-size: 0.8rem;
  opacity: 0.6;
}

/* ===================================
   RESPONSIVE ADJUSTMENTS
   =================================== */
@media (max-width: 639px) {
  .tool-card {
    padding: 18px;
  }

  main {
    padding: 20px 0 40px;
  }

  .hero {
    margin-bottom: 20px;
  }
}
