/*
Theme Name: Gerador de CPF
Theme URI: https://example.com/gerador-de-cpf
Author: Gerador de CPF
Author URI: https://example.com/
Description: Ferramenta gratuita para gerar e validar CPF e CNPJ para testes de software. Lotes de até 1.000 registros, filtro por estado, exportação CSV/TXT e processamento 100% local no navegador.
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gerador-de-cpf
Tags: tools, utilities, one-column, custom-colors
*/

:root {
      color-scheme: light dark;
      --bg: #f4f7f3;
      --surface: #ffffff;
      --surface-2: #eaf0eb;
      --surface-3: #dfe8e2;
      --ink: #13241f;
      --muted: #53655e;
      --line: #c8d5ce;
      --brand: #075b4b;
      --brand-2: #0b7a62;
      --accent: #f2c94c;
      --danger: #a7382f;
      --success: #087a50;
      --code: #10221d;
      --code-ink: #d8f5e9;
      --shadow: 0 18px 50px rgba(27, 57, 47, .11);
      --radius-lg: 28px;
      --radius-md: 17px;
      --radius-sm: 10px;
      --max: 1180px;
    }
    @media (prefers-color-scheme: dark) {
      :root {
        --bg: #0e1714;
        --surface: #15231f;
        --surface-2: #1c2f29;
        --surface-3: #263b34;
        --ink: #edf7f2;
        --muted: #a9bbb3;
        --line: #31483f;
        --brand: #52d4ae;
        --brand-2: #79e6c6;
        --accent: #f0c84a;
        --danger: #ff958b;
        --success: #66ddb4;
        --code: #09110f;
        --code-ink: #d8f5e9;
        --shadow: 0 18px 54px rgba(0, 0, 0, .28);
      }
    }
    html[data-theme="light"] {
      color-scheme: light;
      --bg: #f4f7f3; --surface: #ffffff; --surface-2: #eaf0eb; --surface-3: #dfe8e2;
      --ink: #13241f; --muted: #53655e; --line: #c8d5ce; --brand: #075b4b;
      --brand-2: #0b7a62; --accent: #f2c94c; --danger: #a7382f; --success: #087a50;
      --code: #10221d; --code-ink: #d8f5e9; --shadow: 0 18px 50px rgba(27,57,47,.11);
    }
    html[data-theme="dark"] {
      color-scheme: dark;
      --bg: #0e1714; --surface: #15231f; --surface-2: #1c2f29; --surface-3: #263b34;
      --ink: #edf7f2; --muted: #a9bbb3; --line: #31483f; --brand: #52d4ae;
      --brand-2: #79e6c6; --accent: #f0c84a; --danger: #ff958b; --success: #66ddb4;
      --code: #09110f; --code-ink: #d8f5e9; --shadow: 0 18px 54px rgba(0,0,0,.28);
    }
    * { box-sizing: border-box; }
    html { scroll-behavior: smooth; scroll-padding-top: 76px; }
    body {
      margin: 0;
      background: var(--bg);
      color: var(--ink);
      font-family: "IBM Plex Sans", sans-serif;
      font-size: 16px;
      line-height: 1.58;
      text-rendering: optimizeLegibility;
    }
    button, input, select, textarea { font: inherit; }
    button { cursor: pointer; }
    a { color: inherit; }
    .skip-link { position: fixed; left: 12px; top: -80px; z-index: 50; padding: 10px 14px; background: var(--ink); color: var(--bg); }
    .skip-link:focus { top: 12px; }
    .nav-shell {
      position: sticky; top: 0; z-index: 30;
      border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 25%);
      background: color-mix(in srgb, var(--bg), transparent 6%);
      backdrop-filter: blur(14px);
    }
    .nav {
      width: min(var(--max), calc(100% - 32px)); margin: 0 auto;
      min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 18px;
    }
    .nav-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
    .nav a { text-decoration: none; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: .91rem; }
    .nav a:hover, .nav a:focus-visible { background: var(--surface-2); color: var(--ink); outline: none; }
    .icon-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; }
    .icon-btn:hover { border-color: var(--brand); }
    .wrap { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }
    .hero { padding: clamp(48px, 8vw, 96px) 0 34px; display: grid; grid-template-columns: 1.12fr .88fr; gap: clamp(32px, 6vw, 78px); align-items: end; }
    .privacy-line { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; color: var(--brand); margin-bottom: 18px; }
    .privacy-line svg { width: 19px; height: 19px; }
    h1, h2, h3 { font-family: "Bitter", Georgia, serif; line-height: 1.08; margin: 0; letter-spacing: -.025em; }
    h1 { font-size: clamp(2.75rem, 6.4vw, 5.9rem); max-width: 850px; }
    h2 { font-size: clamp(2rem, 4vw, 3.4rem); }
    h3 { font-size: 1.25rem; }
    .hero-copy { color: var(--muted); font-size: clamp(1.08rem, 1.8vw, 1.28rem); max-width: 660px; margin: 24px 0 0; }
    .hero-notes { border-top: 1px solid var(--line); padding-top: 22px; display: grid; gap: 14px; }
    .hero-note { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
    .hero-note strong { display: block; }
    .hero-note span { color: var(--muted); font-size: .93rem; }
    .num { width: 28px; height: 28px; display: grid; place-items: center; background: var(--accent); color: #2c2406; border-radius: 50%; font-weight: 800; font-size: .84rem; }
    .tool-shell { margin: 26px auto 84px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
    .tool-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
    .segmented { display: flex; background: var(--surface-3); padding: 4px; border-radius: 12px; gap: 3px; }
    .segmented button { border: 0; background: transparent; color: var(--muted); font-weight: 700; border-radius: 9px; padding: 10px 18px; }
    .segmented button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 2px 9px rgba(0,0,0,.08); }
    .local-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--success); font-weight: 700; font-size: .88rem; }
    .local-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor, transparent 82%); }
    .tool-layout { display: grid; grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); min-height: 560px; }
    .controls { padding: clamp(24px, 4vw, 42px); border-right: 1px solid var(--line); }
    .results { padding: clamp(24px, 4vw, 42px); background: color-mix(in srgb, var(--surface-2), transparent 25%); min-width: 0; }
    .mode-title { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 26px; }
    .mode-title p { margin: 7px 0 0; color: var(--muted); }
    .field { margin-bottom: 22px; }
    .field label, .field legend { display: block; font-weight: 700; margin-bottom: 9px; }
    fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
    .choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
    .choice { position: relative; }
    .choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 1; appearance: none; cursor: pointer; z-index: 2; border-radius: 9px; }
    .choice span { display: block; min-width: 48px; padding: 9px 12px; text-align: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-weight: 600; }
    .choice input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
    select, textarea, .text-input { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); padding: 12px 14px; }
    textarea { min-height: 170px; resize: vertical; font-family: "IBM Plex Mono", monospace; }
    select:focus, textarea:focus, .text-input:focus { outline: 3px solid color-mix(in srgb, var(--brand), transparent 76%); border-color: var(--brand); }
    .toggle-line { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 12px 0; }
    .toggle-line + .toggle-line { border-top: 1px solid var(--line); }
    .toggle-label strong { display: block; }
    .toggle-label small { color: var(--muted); }
    .switch { position: relative; width: 48px; height: 28px; flex: 0 0 auto; }
    .switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 1; appearance: none; cursor: pointer; z-index: 2; border-radius: 999px; }
    .slider { position: absolute; inset: 0; background: var(--surface-3); border: 1px solid var(--line); border-radius: 999px; transition: .2s; }
    .slider::after { content: ""; position: absolute; width: 20px; height: 20px; top: 3px; left: 3px; border-radius: 50%; background: var(--muted); transition: .2s; }
    .switch input:checked + .slider { background: var(--brand); border-color: var(--brand); }
    .switch input:checked + .slider::after { transform: translateX(20px); background: var(--surface); }
    .primary { width: 100%; border: 0; background: var(--brand); color: var(--bg); font-weight: 800; padding: 14px 18px; border-radius: 11px; box-shadow: 0 8px 22px color-mix(in srgb, var(--brand), transparent 72%); }
    .primary:hover { background: var(--brand-2); }
    .primary:focus-visible, .secondary:focus-visible, .tool-chip:focus-visible, .code-copy:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand), transparent 58%); outline-offset: 2px; }
    .result-head { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 20px; }
    .result-head p { margin: 4px 0 0; color: var(--muted); font-size: .93rem; }
    .action-row { display: flex; gap: 8px; flex-wrap: wrap; }
    .secondary { border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 9px 12px; border-radius: 9px; font-weight: 700; }
    .secondary:hover { border-color: var(--brand); color: var(--brand); }
    .result-box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
    .result-list { min-height: 310px; max-height: 380px; overflow: auto; padding: 8px; }
    .empty { min-height: 294px; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 28px; }
    .empty svg { width: 74px; height: 74px; margin-bottom: 14px; color: var(--brand); }
    .result-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 12px; border-radius: 8px; font-family: "IBM Plex Mono", monospace; }
    .result-item:nth-child(even) { background: var(--surface-2); }
    .result-item button { border: 0; background: transparent; color: var(--brand); font-weight: 700; }
    .validity { font-family: "IBM Plex Sans", sans-serif; font-size: .83rem; font-weight: 800; border-radius: 999px; padding: 5px 8px; }
    .validity.ok { color: var(--success); background: color-mix(in srgb, var(--success), transparent 88%); }
    .validity.bad { color: var(--danger); background: color-mix(in srgb, var(--danger), transparent 88%); }
    .result-foot { border-top: 1px solid var(--line); padding: 11px 14px; display: flex; justify-content: space-between; gap: 16px; font-size: .84rem; color: var(--muted); }
    .notice { margin-top: 17px; padding: 13px 15px; border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent), transparent 88%); color: var(--muted); font-size: .9rem; }
    .notice strong { color: var(--ink); }
    .section { padding: clamp(68px, 9vw, 112px) 0; border-top: 1px solid var(--line); }
    .section-head { display: grid; grid-template-columns: minmax(0, .85fr) minmax(300px, 1.15fr); gap: clamp(28px, 7vw, 90px); align-items: end; margin-bottom: 44px; }
    .section-head p { color: var(--muted); font-size: 1.08rem; margin: 0; max-width: 700px; }
    .kicker { display: block; color: var(--brand); font-weight: 800; margin-bottom: 12px; }
    .definition-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 22px; }
    .text-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: clamp(24px, 4vw, 38px); }
    .text-panel p { color: var(--muted); }
    .compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 25px; }
    .compare div { padding: 16px; background: var(--surface-2); border-radius: 12px; }
    .compare strong { display: block; font-size: 1.15rem; }
    .compare span { color: var(--muted); font-size: .9rem; }
    .use-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
    .use-list li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
    .use-list li:last-child { border-bottom: 0; }
    .use-list svg { width: 24px; height: 24px; color: var(--brand); margin-top: 2px; }
    .use-list strong { display: block; }
    .use-list span { color: var(--muted); font-size: .93rem; }
    .stepper { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 26px; }
    .step-nav { display: grid; gap: 8px; align-content: start; }
    .step-btn { text-align: left; border: 1px solid transparent; background: transparent; color: var(--muted); padding: 13px 14px; border-radius: 10px; font-weight: 700; }
    .step-btn[aria-selected="true"] { border-color: var(--line); background: var(--surface); color: var(--ink); }
    .step-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: clamp(24px, 4vw, 38px); min-width: 0; }
    .calc-line { display: flex; gap: 7px; flex-wrap: wrap; margin: 24px 0; }
    .digit-pair { min-width: 54px; padding: 10px 8px; border-radius: 9px; background: var(--surface-2); text-align: center; font-family: "IBM Plex Mono", monospace; }
    .digit-pair b { display: block; font-size: 1.05rem; }
    .digit-pair small { color: var(--muted); }
    .equation { padding: 16px 18px; background: var(--code); color: var(--code-ink); border-radius: 11px; font-family: "IBM Plex Mono", monospace; overflow-wrap: anywhere; }
    .region-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; display: table; }
    .region-table th, .region-table td { text-align: left; padding: 15px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
    .region-table th { background: var(--surface-2); font-family: "Bitter", Georgia, serif; }
    .region-table tr:last-child td { border-bottom: 0; }
    .region-num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--bg); font-weight: 800; }
    .code-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
    .tool-chip { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 9px; padding: 9px 13px; font-weight: 700; }
    .tool-chip[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
    .code-wrap { position: relative; }
    pre { margin: 0; padding: 24px; background: var(--code); color: var(--code-ink); border-radius: var(--radius-md); overflow: auto; line-height: 1.65; font-family: "IBM Plex Mono", monospace; font-size: .87rem; }
    .code-copy { position: absolute; top: 12px; right: 12px; border: 1px solid #3f5f54; background: #183129; color: #d8f5e9; border-radius: 8px; padding: 8px 10px; font-weight: 700; }
    .dev-grid { display: grid; grid-template-columns: 1fr .34fr; gap: 22px; }
    .dev-aside { padding: 25px; background: var(--accent); color: #302808; border-radius: var(--radius-md); }
    .dev-aside p { margin-bottom: 0; }
    .related { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
    .related a { text-decoration: none; padding: 10px 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; font-weight: 700; }
    .related a:hover { color: var(--brand); border-color: var(--brand); }
    .faq { max-width: 900px; margin: 0 auto; }
    details { border-top: 1px solid var(--line); }
    details:last-child { border-bottom: 1px solid var(--line); }
    summary { list-style: none; cursor: pointer; padding: 23px 6px; font-family: "Bitter", Georgia, serif; font-size: 1.15rem; font-weight: 700; display: flex; justify-content: space-between; gap: 20px; }
    summary::-webkit-details-marker { display: none; }
    summary::after { content: "+"; color: var(--brand); font-family: "IBM Plex Sans", sans-serif; font-size: 1.4rem; }
    details[open] summary::after { content: "−"; }
    details p { color: var(--muted); margin: 0; padding: 0 40px 22px 6px; }
    footer { padding: 34px 0 48px; border-top: 1px solid var(--line); color: var(--muted); }
    .footer-inner { display: flex; justify-content: space-between; gap: 22px; align-items: center; }
    .footer-inner nav { display: flex; gap: 16px; flex-wrap: wrap; }
    .footer-inner a { color: var(--muted); }
    .toast { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translate(-50%, 120px); background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 10px; font-weight: 700; box-shadow: var(--shadow); transition: transform .25s ease; }
    .toast.show { transform: translate(-50%, 0); }
    .sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
    [hidden] { display: none !important; }
    @media (max-width: 860px) {
      .hero, .section-head, .definition-grid, .dev-grid { grid-template-columns: 1fr; }
      .hero { align-items: start; }
      .tool-layout { grid-template-columns: 1fr; }
      .controls { border-right: 0; border-bottom: 1px solid var(--line); }
      .stepper { grid-template-columns: 1fr; }
      .step-nav { grid-template-columns: repeat(4, 1fr); }
      .step-btn { text-align: center; padding: 10px 8px; font-size: .88rem; }
      .region-table, .region-table tbody, .region-table tr, .region-table th, .region-table td { display: block; }
      .region-table thead { display: none; }
      .region-table tr { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 52px 1fr; align-items: center; }
      .region-table td { border: 0; padding: 4px; }
    }
    @media (max-width: 640px) {
      .wrap, .nav { width: min(100% - 22px, var(--max)); }
      .nav { min-height: 58px; }
      .nav-links a:nth-child(n+4) { display: none; }
      .hero { padding-top: 42px; }
      h1 { font-size: clamp(2.45rem, 13vw, 4rem); }
      .tool-shell { border-radius: 19px; margin-bottom: 60px; }
      .tool-top { align-items: stretch; flex-direction: column; }
      .segmented { width: 100%; }
      .segmented button { flex: 1; padding-inline: 8px; }
      .result-head { align-items: stretch; flex-direction: column; }
      .action-row { display: grid; grid-template-columns: repeat(3, 1fr); }
      .secondary { padding-inline: 7px; font-size: .87rem; }
      .compare { grid-template-columns: 1fr; }
      .step-nav { overflow: visible; grid-template-columns: 1fr 1fr; }
      .step-btn { white-space: normal; }
      .footer-inner { align-items: flex-start; flex-direction: column; }
      .result-item { align-items: flex-start; }
      .result-item code { overflow-wrap: anywhere; }
    }
    @media (prefers-reduced-motion: reduce) {
      html { scroll-behavior: auto; }
      *, *::before, *::after { transition: none !important; }
    }
