/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --accent:       #65A30D;   /* verde lima — primario, herramientas developer */
  --accent-dark:  #4D7C0F;
  --accent-soft:  #ECFCCB;
  --accent-2:     #E8590C;   /* naranja — avisos */
  --accent-2-ink: #B84400;
  --accent-2-soft:#FFE9DA;

  --ok:      #0F8A5F;
  --ok-soft: #E3F5EC;
  --err:     #DC2626;
  --err-soft:#FDE8E8;

  --on-accent: #FFFFFF;

  --bg:        #F7F8FC;
  --bg-2:      #EEF0FA;
  --card:      #FFFFFF;
  --text:      #12172B;
  --text-soft: #565F7E;
  --border:    #DEE1F2;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --serif: "Fredoka", ui-rounded, system-ui, sans-serif;
  --sans:  "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --mono:  ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent:       #A3E635;
    --accent-dark:  #BEF264;
    --accent-soft:  #263405;
    --accent-2:     #FF9B5C;
    --accent-2-ink: #FFB989;
    --accent-2-soft:#3A2410;

    --ok:      #22C58B;
    --ok-soft: #123024;
    --err:     #F87171;
    --err-soft:#3A1414;

    --on-accent: #14200A;

    --bg:        #0C0D18;
    --bg-2:      #12142A;
    --card:      #171A33;
    --text:      #EEF0FA;
    --text-soft: #A6ACC8;
    --border:    #262A4A;
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.1; font-family: var(--serif); font-weight: 600; }
::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =============================================================
   3. Utilities
   ============================================================= */
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--card); color: var(--text);
  z-index: 9999; border-radius: 8px; font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.skip-link:focus { top: 1rem; }

.wrap { width: 100%; max-width: 1100px; margin-inline: auto; padding-inline: 1.25rem; }
.wrap--narrow { max-width: 760px; }
.wrap--wide { max-width: 1240px; }

/* =============================================================
   4. Typography
   ============================================================= */
.section-title {
  font-size: clamp(1.9rem, 5vw, 2.7rem);
  letter-spacing: -0.01em;
  text-align: center;
  margin-inline: auto;
  max-width: 24ch;
}
.section-sub {
  text-align: center;
  color: var(--text-soft);
  max-width: 52ch;
  margin: .7rem auto 0;
  font-size: 1.05rem;
}
.section-title-sm {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: 1.4rem;
}

/* =============================================================
   5. Components
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  padding: .8rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: .95rem;
  transition: transform .2s var(--ease-out), background .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); transform: translateY(-1px); }
.btn-ghost {
  background: var(--bg-2); color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: .5rem 1rem; font-size: .85rem; }

/* =============================================================
   6. Header / footer
   ============================================================= */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: .8rem;
}
.brand { display: flex; align-items: center; gap: .5rem; color: var(--accent); }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; color: var(--text); }
.site-nav { display: flex; gap: 1.4rem; font-weight: 600; font-size: .92rem; }
.site-nav a { color: var(--text-soft); transition: color .2s var(--ease-out); }
.site-nav a:hover { color: var(--accent); }
@media (max-width: 719px) { .site-nav { display: none; } }

.lang-switch {
  display: flex; align-items: center; gap: .12rem;
  margin-left: auto;
  flex-wrap: nowrap;
}
.site-nav + .lang-switch { margin-left: .35rem; }
.lang-switch a {
  display: inline-block;
  font-size: .74rem; font-weight: 700; letter-spacing: .03em;
  line-height: 1;
  color: var(--text-soft);
  padding: .34rem .38rem;
  border-radius: 8px;
  transition: color .2s var(--ease-out), background .2s var(--ease-out);
}
.lang-switch a:hover { color: var(--accent); background: var(--accent-soft); }
.lang-switch a.is-on { color: var(--on-accent); background: var(--accent); }
@media (max-width: 700px) {
  .lang-switch a { padding: .3rem .3rem; font-size: .7rem; }
}
@media (max-width: 380px) {
  .lang-switch { gap: 0; }
  .lang-switch a { padding: .28rem .22rem; font-size: .66rem; }
}

.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; padding-block: 2rem; }
.site-footer-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; }
.foot-brand { color: var(--text-soft); font-size: .92rem; }
.foot-nav { display: flex; gap: 1.2rem; font-size: .92rem; font-weight: 600; }
.foot-nav a:hover { color: var(--accent); }

/* =============================================================
   7. Sections
   ============================================================= */
.section { padding-block: 2.6rem; }
.section--tool { padding-top: 2.2rem; }

/* =============================================================
   8. Tool card
   ============================================================= */
.tool-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  margin-top: 1.8rem;
  box-shadow: 0 20px 50px -30px rgba(0,0,0,.25);
}
.tool-card-body { display: flex; flex-direction: column; gap: 1.2rem; }

/* =============================================================
   8b. Herramienta de texto (Base64 / dev tools)
   ============================================================= */
.dev-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
}
.dev-toolbar .btn-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.dev-toolbar-spacer { flex: 1 1 auto; }
.char-count { font-size: .82rem; color: var(--text-soft); }

.checkbox-field {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .85rem; color: var(--text-soft); font-weight: 600;
}
.checkbox-field input { width: 16px; height: 16px; accent-color: var(--accent); }

.dev-textarea {
  width: 100%;
  min-height: 360px;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: .88rem;
  line-height: 1.55;
  resize: vertical;
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out);
}
.dev-textarea:focus {
  outline: none; border-color: var(--accent); background: var(--card);
}
.dev-textarea.is-invalid { border-color: var(--err); }

.status-line {
  display: flex; align-items: center; gap: .5rem;
  padding: .7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .88rem; font-weight: 600;
  background: var(--bg-2); color: var(--text-soft);
}
.status-line svg { flex-shrink: 0; }
.status-line.is-ok { background: var(--ok-soft); color: var(--ok); }
.status-line.is-err { background: var(--err-soft); color: var(--err); }

.copy-toast {
  position: fixed; left: 50%; bottom: 1.6rem; transform: translate(-50%, 12px);
  background: var(--text); color: var(--bg);
  padding: .6rem 1.1rem; border-radius: var(--radius-sm);
  font-size: .88rem; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease-out), transform .25s var(--ease-out);
  z-index: 999;
}
.copy-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* =============================================================
   9. Ad slots
   ============================================================= */
.ad-slot {
  min-height: 90px;
  margin-block: 1.8rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-soft);
}
.ad-slot-label { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }

/* =============================================================
   10. Steps / prose / FAQ / more-tools
   ============================================================= */
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  margin-bottom: 2.6rem;
}
@media (max-width: 719px) { .steps { grid-template-columns: 1fr; } }
.step { display: flex; flex-direction: column; gap: .5rem; }
.step svg { color: var(--accent); }
.step h3 { font-size: 1.05rem; }
.step p { color: var(--text-soft); font-size: .92rem; }

.prose { display: flex; flex-direction: column; gap: 1rem; }
.prose h2 { font-size: 1.4rem; margin-top: .6rem; }
.prose h3 { font-size: 1.1rem; margin-top: .4rem; }
.prose p { color: var(--text-soft); }

.faq-list { display: flex; flex-direction: column; gap: .6rem; }
.faq-item {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .9rem 1.1rem;
  background: var(--card);
}
.faq-item summary {
  cursor: pointer; font-weight: 700; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-size: 1.3rem; color: var(--accent); flex-shrink: 0;
  transition: transform .2s var(--ease-out);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { color: var(--text-soft); margin-top: .6rem; font-size: .93rem; }

.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.tool-link-card {
  display: flex; flex-direction: column; gap: .3rem;
  padding: 1.1rem 1.2rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  transition: border-color .2s var(--ease-out), transform .2s var(--ease-out);
}
.tool-link-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.tool-link-name { font-weight: 700; color: var(--accent-dark); }
.tool-link-desc { font-size: .85rem; color: var(--text-soft); }

/* =============================================================
   11. Responsive
   ============================================================= */
@media (min-width: 720px) {
  .tool-card { padding: 2.2rem; }
}
