/* ===== RESET & BASE ===== */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root{
  /* WhatsApp Greens */
  --green-light:#25D366;
  --green-mid:#128C7E;
  --green-dark:#075E54;
  --green-hover:#06CF65;
  /* Chat colours */
  --chat-bg:#ECE5DD;
  --bubble-green:#DCF8C6;
  --bubble-white:#fff;
  /* Neutrals */
  --bg:#f8f9fa;
  --bg-alt:#fff;
  --text:#1a1a2e;
  --text-secondary:#555;
  --border:#e0e0e0;
  --shadow:0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:0 8px 30px rgba(0,0,0,.12);
  /* Sizes */
  --max-w:1100px;
  --radius:12px;
  --radius-sm:8px;
  /* Transition */
  --transition:0.3s ease;
}

/* ===== DARK MODE ===== */
[data-theme="dark"]{
  --bg:#0d1117;
  --bg-alt:#161b22;
  --text:#e6edf3;
  --text-secondary:#8b949e;
  --border:#30363d;
  --shadow:0 2px 12px rgba(0,0,0,.3);
  --shadow-lg:0 8px 30px rgba(0,0,0,.4);
  --chat-bg:#0b141a;
  --bubble-green:#005c4b;
  --bubble-white:#1f2c34;
}

@media(prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#0d1117;
    --bg-alt:#161b22;
    --text:#e6edf3;
    --text-secondary:#8b949e;
    --border:#30363d;
    --shadow:0 2px 12px rgba(0,0,0,.3);
    --shadow-lg:0 8px 30px rgba(0,0,0,.4);
    --chat-bg:#0b141a;
    --bubble-green:#005c4b;
    --bubble-white:#1f2c34;
  }
}

html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{
  font-family:'Inter',system-ui,-apple-system,sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.7;
  font-size:16px;
  min-height:100vh;
  display:flex;
  flex-direction:column;
}
main{flex:1}
img,svg{max-width:100%;display:block}
a{color:var(--green-mid);text-decoration:none;transition:color var(--transition)}
a:hover{color:var(--green-dark)}
ul,ol{padding-left:1.5em}
code{background:var(--bg);padding:2px 6px;border-radius:4px;font-size:.9em}
pre{background:var(--bg-alt);border:1px solid var(--border);border-radius:var(--radius-sm);padding:1em;overflow-x:auto}
pre code{background:none;padding:0}

/* ===== TYPOGRAPHY ===== */
h1,h2,h3,h4{line-height:1.3;color:var(--text)}
h1{font-size:clamp(1.8rem,4vw,2.5rem);font-weight:800}
h2{font-size:clamp(1.4rem,3vw,1.9rem);font-weight:700}
h3{font-size:clamp(1.1rem,2.5vw,1.4rem);font-weight:600}

/* ===== LAYOUT ===== */
.container{width:100%;max-width:var(--max-w);margin:0 auto;padding:0 1rem}
.section{padding:3rem 0}
.section--alt{background:var(--bg-alt)}

/* ===== HEADER ===== */
.header{
  background:var(--green-dark);
  color:#fff;
  padding:.75rem 0;
  position:sticky;
  top:0;
  z-index:100;
  box-shadow:0 2px 8px rgba(0,0,0,.15);
}
.header .container{display:flex;align-items:center;justify-content:space-between;gap:1rem}
.header__logo{display:flex;align-items:center;gap:.5rem;color:#fff;font-weight:700;font-size:1.1rem}
.header__logo img,.header__logo svg{width:32px;height:32px}
.header__nav{display:flex;align-items:center;gap:1.5rem}
.header__nav a{color:rgba(255,255,255,.9);font-size:.95rem;font-weight:500}
.header__nav a:hover{color:#fff}
.header__toggle{
  background:none;border:none;color:#fff;cursor:pointer;
  width:36px;height:36px;display:flex;align-items:center;justify-content:center;
  border-radius:50%;transition:background var(--transition);
}
.header__toggle:hover{background:rgba(255,255,255,.15)}
.header__toggle svg{width:20px;height:20px}

/* Mobile menu */
.header__hamburger{
  display:none;background:none;border:none;color:#fff;cursor:pointer;
  width:36px;height:36px;align-items:center;justify-content:center;
}
@media(max-width:768px){
  .header__hamburger{display:flex}
  .header__nav{
    display:none;position:absolute;top:100%;left:0;right:0;
    background:var(--green-dark);flex-direction:column;padding:1rem;gap:.5rem;
    box-shadow:0 4px 12px rgba(0,0,0,.2);
  }
  .header__nav.open{display:flex}
  .header__nav a{padding:.5rem 0;width:100%}
}

/* ===== HERO ===== */
.hero{
  background:linear-gradient(135deg,var(--green-dark) 0%,var(--green-mid) 100%);
  color:#fff;
  padding:3rem 0 2rem;
  text-align:center;
}
.hero h1{color:#fff;margin-bottom:.75rem}
.hero p{font-size:1.15rem;opacity:.92;max-width:600px;margin:0 auto}

/* ===== BREADCRUMB ===== */
.breadcrumb{
  padding:.75rem 0;font-size:.85rem;color:var(--text-secondary);
}
.breadcrumb a{color:var(--green-mid)}
.breadcrumb span{margin:0 .4rem;opacity:.5}

/* ===== GENERATOR CARD ===== */
.generator{
  background:var(--bg-alt);
  border-radius:var(--radius);
  box-shadow:var(--shadow-lg);
  padding:2rem;
  margin:-2rem auto 2rem;
  max-width:680px;
  position:relative;
  z-index:10;
}

/* Form elements */
.form-group{margin-bottom:1.25rem}
.form-group label{display:block;font-weight:600;margin-bottom:.4rem;font-size:.95rem}
.form-group small{display:block;color:var(--text-secondary);font-size:.8rem;margin-top:.25rem}

.input-row{display:flex;gap:.5rem}
.country-select{
  width:110px;flex-shrink:0;
  padding:.65rem .5rem;
  border:2px solid var(--border);
  border-radius:var(--radius-sm);
  background:var(--bg);
  color:var(--text);
  font-size:.95rem;
  cursor:pointer;
}
.phone-input,.text-input,.textarea-input{
  width:100%;
  padding:.65rem .85rem;
  border:2px solid var(--border);
  border-radius:var(--radius-sm);
  font-size:1rem;
  font-family:inherit;
  background:var(--bg);
  color:var(--text);
  transition:border-color var(--transition);
}
.phone-input:focus,.text-input:focus,.textarea-input:focus,.country-select:focus{
  outline:none;
  border-color:var(--green-light);
  box-shadow:0 0 0 3px rgba(37,211,102,.15);
}
.textarea-input{resize:vertical;min-height:100px;line-height:1.6}

/* Alias row */
.alias-row{align-items:center}
.alias-prefix{
  background:var(--bg);border:2px solid var(--border);
  border-right:none;border-radius:var(--radius-sm) 0 0 var(--radius-sm);
  padding:.65rem .6rem;font-size:.85rem;color:var(--text-secondary);
  white-space:nowrap;font-weight:500;
}
.alias-row .text-input{border-top-left-radius:0;border-bottom-left-radius:0}
.alias-status{
  font-size:.8rem;margin-top:.25rem;min-height:1.2em;
}
.alias-status.success{color:var(--green-mid)}
.alias-status.error{color:#e53e3e}
.alias-status.loading{color:var(--text-secondary)}

/* Advanced toggle */
.advanced-toggle{
  margin-bottom:1.25rem;border:1px solid var(--border);
  border-radius:var(--radius-sm);overflow:hidden;
}
.advanced-toggle summary{
  padding:.75rem 1rem;cursor:pointer;font-size:.9rem;font-weight:500;
  color:var(--text-secondary);display:flex;align-items:center;gap:.5rem;
  list-style:none;background:var(--bg);
  transition:background var(--transition);
}
.advanced-toggle summary::-webkit-details-marker{display:none}
.advanced-toggle summary:hover{background:var(--border)}
.advanced-toggle[open] summary{border-bottom:1px solid var(--border)}
.advanced-content{padding:1rem}
.advanced-content .form-group:last-child{margin-bottom:0}

/* Formatting toolbar */
.toolbar{
  display:flex;gap:.25rem;padding:.4rem;
  background:var(--bg);border:2px solid var(--border);
  border-bottom:none;border-radius:var(--radius-sm) var(--radius-sm) 0 0;
}
.toolbar+.textarea-input{border-top-left-radius:0;border-top-right-radius:0}
.toolbar button{
  background:none;border:1px solid transparent;border-radius:4px;
  padding:.3rem .55rem;cursor:pointer;font-size:.85rem;
  color:var(--text);transition:all var(--transition);
  font-family:'Courier New',monospace;font-weight:700;
}
.toolbar button:hover{background:var(--border);border-color:var(--border)}

/* Chat preview */
.preview{
  background:var(--chat-bg);
  border-radius:var(--radius-sm);
  padding:1rem;
  min-height:80px;
  margin-bottom:1.25rem;
}
.preview__bubble{
  background:var(--bubble-green);
  border-radius:8px 8px 0 8px;
  padding:.6rem .85rem;
  max-width:85%;
  margin-left:auto;
  font-size:.95rem;
  line-height:1.5;
  word-break:break-word;
  position:relative;
  box-shadow:0 1px 1px rgba(0,0,0,.08);
}
.preview__bubble::after{
  content:'';position:absolute;bottom:0;right:-8px;
  width:0;height:0;
  border-left:8px solid var(--bubble-green);
  border-bottom:8px solid transparent;
}
.preview__placeholder{color:var(--text-secondary);font-style:italic;font-size:.9rem;text-align:center;padding:1rem 0}
.preview__time{font-size:.7rem;color:var(--text-secondary);text-align:right;margin-top:.25rem}

/* Generate button */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.5rem;
  padding:.75rem 1.75rem;border:none;border-radius:var(--radius-sm);
  font-size:1rem;font-weight:600;cursor:pointer;
  transition:all var(--transition);font-family:inherit;
}
.btn--primary{
  background:var(--green-light);color:#fff;width:100%;
  font-size:1.1rem;padding:.85rem;
}
.btn--primary:hover{background:var(--green-hover);transform:translateY(-1px);box-shadow:0 4px 15px rgba(37,211,102,.35)}
.btn--primary:active{transform:translateY(0)}

.btn--secondary{
  background:var(--bg);color:var(--text);border:2px solid var(--border);
}
.btn--secondary:hover{border-color:var(--green-mid);color:var(--green-mid)}

.btn--small{padding:.5rem 1rem;font-size:.9rem}

/* Result area */
.result{
  display:none;margin-top:1.5rem;padding-top:1.5rem;
  border-top:2px solid var(--border);
  animation:fadeSlideUp .4s ease;
}
.result.active{display:block}
.result__link{
  background:var(--bg);
  border:2px solid var(--green-light);
  border-radius:var(--radius-sm);
  padding:.75rem 1rem;
  display:flex;align-items:center;gap:.75rem;
  margin-bottom:1rem;
  word-break:break-all;
}
.result__link a{flex:1;font-weight:600;color:var(--green-mid);font-size:.95rem}
.result__actions{display:flex;gap:.5rem;flex-wrap:wrap;margin-bottom:1rem}
.result__qr{text-align:center;margin-top:1rem}
.result__qr canvas{margin:0 auto;border-radius:var(--radius-sm)}

/* Copy feedback */
.copy-feedback{
  position:fixed;top:1rem;right:1rem;
  background:var(--green-dark);color:#fff;
  padding:.6rem 1.2rem;border-radius:var(--radius-sm);
  font-weight:600;z-index:200;
  animation:fadeSlideDown .3s ease;
  pointer-events:none;
}

/* ===== FAQ ===== */
.faq{max-width:750px;margin:0 auto}
.faq details{
  background:var(--bg-alt);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  margin-bottom:.5rem;
  transition:box-shadow var(--transition);
}
.faq details[open]{box-shadow:var(--shadow)}
.faq summary{
  padding:1rem 1.25rem;cursor:pointer;font-weight:600;
  list-style:none;display:flex;justify-content:space-between;align-items:center;
}
.faq summary::-webkit-details-marker{display:none}
.faq summary::after{content:'+';font-size:1.3rem;font-weight:400;color:var(--green-mid);transition:transform var(--transition)}
.faq details[open] summary::after{content:'-'}
.faq .faq__answer{padding:0 1.25rem 1rem;color:var(--text-secondary);line-height:1.7}

/* ===== GUIDES / CARDS ===== */
.guides-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
  gap:1.25rem;
}
.card{
  background:var(--bg-alt);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:1.5rem;
  transition:all var(--transition);
  display:flex;flex-direction:column;
}
.card:hover{box-shadow:var(--shadow-lg);transform:translateY(-2px);border-color:var(--green-light)}
.card__tag{
  display:inline-block;background:rgba(37,211,102,.1);color:var(--green-mid);
  font-size:.75rem;font-weight:600;padding:.2rem .6rem;border-radius:20px;
  margin-bottom:.75rem;width:fit-content;
}
.card h3{margin-bottom:.5rem}
.card h3 a{color:var(--text)}
.card h3 a:hover{color:var(--green-mid)}
.card p{color:var(--text-secondary);font-size:.9rem;flex:1}
.card__link{
  display:inline-flex;align-items:center;gap:.3rem;
  margin-top:.75rem;font-weight:600;font-size:.9rem;color:var(--green-mid);
}
.card__link:hover{color:var(--green-dark)}

/* ===== BLOG ===== */
.blog-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(300px,1fr));
  gap:1.5rem;
}
.blog-card{
  background:var(--bg-alt);
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  transition:all var(--transition);
}
.blog-card:hover{box-shadow:var(--shadow-lg);transform:translateY(-2px)}
.blog-card__body{padding:1.25rem}
.blog-card__tag{
  display:inline-block;background:rgba(37,211,102,.1);color:var(--green-mid);
  font-size:.75rem;font-weight:600;padding:.2rem .6rem;border-radius:20px;
  margin-bottom:.5rem;
}
.blog-card h3{margin-bottom:.5rem;font-size:1.1rem}
.blog-card h3 a{color:var(--text)}
.blog-card h3 a:hover{color:var(--green-mid)}
.blog-card p{color:var(--text-secondary);font-size:.9rem;line-height:1.6}
.blog-card__meta{
  display:flex;align-items:center;gap:1rem;
  margin-top:.75rem;font-size:.8rem;color:var(--text-secondary);
}

/* Blog filter */
.blog-filter{
  display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:1.5rem;
}
.blog-filter button{
  padding:.4rem 1rem;border:2px solid var(--border);border-radius:20px;
  background:var(--bg);color:var(--text);cursor:pointer;font-size:.85rem;
  font-family:inherit;transition:all var(--transition);
}
.blog-filter button.active,.blog-filter button:hover{
  border-color:var(--green-mid);background:var(--green-mid);color:#fff;
}

/* ===== ARTICLE ===== */
.article{max-width:750px;margin:0 auto}
.article h1{margin-bottom:1rem}
.article__meta{
  display:flex;align-items:center;gap:1rem;
  color:var(--text-secondary);font-size:.9rem;margin-bottom:2rem;
  padding-bottom:1rem;border-bottom:1px solid var(--border);
}
.article h2{margin:2rem 0 .75rem;padding-top:1rem}
.article h3{margin:1.5rem 0 .5rem}
.article p{margin-bottom:1rem;color:var(--text-secondary)}
.article ul,.article ol{margin-bottom:1rem;color:var(--text-secondary)}
.article li{margin-bottom:.4rem}
.article img{border-radius:var(--radius-sm);margin:1rem 0}
.article blockquote{
  border-left:4px solid var(--green-mid);
  padding:.75rem 1rem;margin:1rem 0;
  background:var(--bg);border-radius:0 var(--radius-sm) var(--radius-sm) 0;
  color:var(--text-secondary);
}

/* TOC */
.toc{
  background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-sm);
  padding:1.25rem;margin-bottom:2rem;
}
.toc h4{margin-bottom:.75rem;font-size:.95rem}
.toc ol{padding-left:1.25rem}
.toc li{margin-bottom:.3rem;font-size:.9rem}
.toc a{color:var(--text-secondary)}
.toc a:hover{color:var(--green-mid)}

/* CTA box */
.cta-box{
  background:linear-gradient(135deg,var(--green-dark),var(--green-mid));
  color:#fff;border-radius:var(--radius);padding:2rem;
  text-align:center;margin:2rem 0;
}
.cta-box h3{color:#fff;margin-bottom:.5rem}
.cta-box p{opacity:.9;margin-bottom:1rem}
.cta-box .btn{background:#fff;color:var(--green-dark)}
.cta-box .btn:hover{background:rgba(255,255,255,.9);transform:translateY(-1px)}

/* Related articles */
.related{margin-top:2.5rem;padding-top:1.5rem;border-top:1px solid var(--border)}
.related h3{margin-bottom:1rem}
.related-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:1rem;
}

/* ===== SOBRE ===== */
.about-content{max-width:750px;margin:0 auto}
.about-content p{margin-bottom:1rem;color:var(--text-secondary)}

/* ===== FOOTER ===== */
.footer{
  background:var(--green-dark);color:rgba(255,255,255,.85);
  padding:2.5rem 0 1.5rem;margin-top:auto;
}
.footer__grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
  gap:2rem;margin-bottom:2rem;
}
.footer h4{color:#fff;margin-bottom:.75rem;font-size:1rem}
.footer a{color:rgba(255,255,255,.75);font-size:.9rem}
.footer a:hover{color:#fff}
.footer ul{list-style:none;padding:0}
.footer li{margin-bottom:.4rem}
.footer__bottom{
  border-top:1px solid rgba(255,255,255,.15);
  padding-top:1rem;text-align:center;font-size:.85rem;
  color:rgba(255,255,255,.6);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeSlideUp{
  from{opacity:0;transform:translateY(15px)}
  to{opacity:1;transform:translateY(0)}
}
@keyframes fadeSlideDown{
  from{opacity:0;transform:translateY(-10px)}
  to{opacity:1;transform:translateY(0)}
}
@keyframes shake{
  0%,100%{transform:translateX(0)}
  20%,60%{transform:translateX(-6px)}
  40%,80%{transform:translateX(6px)}
}
.shake{animation:shake .4s ease}

/* ===== UTILITY ===== */
.text-center{text-align:center}
.mt-1{margin-top:.5rem}
.mt-2{margin-top:1rem}
.mt-3{margin-top:1.5rem}
.mt-4{margin-top:2rem}
.mb-1{margin-bottom:.5rem}
.mb-2{margin-bottom:1rem}
.mb-3{margin-bottom:1.5rem}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}

/* ===== RESPONSIVE ===== */
@media(max-width:768px){
  .section{padding:2rem 0}
  .generator{padding:1.25rem;margin:-1.5rem .5rem 1.5rem}
  .hero{padding:2rem 0 1.5rem}
  .input-row{flex-direction:column}
  .country-select{width:100%}
  .result__actions{flex-direction:column}
  .result__actions .btn{width:100%}
  .footer__grid{grid-template-columns:1fr 1fr}
}

@media(max-width:480px){
  body{font-size:15px}
  .generator{margin:-1rem .25rem 1rem;padding:1rem}
  .footer__grid{grid-template-columns:1fr}
  .guides-grid{grid-template-columns:1fr}
  .blog-grid{grid-template-columns:1fr}
}
