/* =============================================
   RAHEG.COM — Design System
   Brazilian Portuguese Tools Website
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,400&display=swap');

:root {
  --primary: #0A6CFF;
  --primary-dark: #0051CC;
  --primary-light: #EBF2FF;
  --accent: #00C896;
  --accent-dark: #009E77;
  --danger: #FF4757;
  --warning: #FFA502;
  --dark: #0D1117;
  --dark-2: #161B22;
  --dark-3: #21262D;
  --mid: #30363D;
  --muted: #6E7681;
  --light-muted: #8B949E;
  --border: #30363D;
  --border-light: #21262D;
  --text: #E6EDF3;
  --text-secondary: #8B949E;
  --text-muted: #6E7681;
  --white: #FFFFFF;
  --surface: #161B22;
  --surface-2: #1C2128;
  --surface-3: #21262D;

  --cat-text: #F7931E;
  --cat-seo: #9B59B6;
  --cat-calc: #27AE60;
  --cat-conv: #E74C3C;
  --cat-dev: #2980B9;

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 24px rgba(10,108,255,0.25);

  --font-heading: 'Sora', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  --transition: 0.2s ease;
  --transition-slow: 0.4s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--dark);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

img { max-width: 100%; display: block; }

h1,h2,h3,h4,h5,h6 { font-family: var(--font-heading); line-height: 1.25; font-weight: 700; }

/* ── CONTAINER ── */
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 820px; margin: 0 auto; padding: 0 24px; }

/* ── HEADER / NAV ── */
.site-header {
  background: rgba(13,17,23,0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--white);
  text-decoration: none;
}
.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.logo span { color: var(--primary); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}
.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--white);
  background: var(--surface-3);
}
.nav-cta {
  background: var(--primary);
  color: var(--white) !important;
  padding: 8px 18px !important;
  border-radius: var(--radius-full) !important;
}
.nav-cta:hover { background: var(--primary-dark) !important; color: var(--white) !important; }
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}
.mobile-nav {
  display: none;
  flex-direction: column;
  padding: 12px 24px 20px;
  border-top: 1px solid var(--border-light);
  gap: 4px;
}
.mobile-nav a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  display: block;
  transition: all var(--transition);
}
.mobile-nav a:hover { color: var(--white); background: var(--surface-3); }
.mobile-nav.open { display: flex; }

/* ── HERO ── */
.hero {
  padding: 80px 0 64px;
  text-align: center;
  background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(10,108,255,0.12) 0%, transparent 70%);
  border-bottom: 1px solid var(--border-light);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(10,108,255,0.15);
  border: 1px solid rgba(10,108,255,0.3);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 24px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  color: var(--white);
  max-width: 700px;
  margin: 0 auto 16px;
  letter-spacing: -0.02em;
}
.hero h1 span { color: var(--primary); }
.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 40px;
  line-height: 1.7;
}
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat strong {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--white);
}
.hero-stat span { font-size: 0.85rem; color: var(--text-muted); }

/* ── CATEGORY SECTION ── */
.section { padding: 64px 0; }
.section-header { margin-bottom: 40px; }
.section-header h2 {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}
.section-header p { color: var(--text-secondary); font-size: 0.95rem; }

/* ── CATEGORY CARDS ── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-decoration: none;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.cat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--cat-color, var(--primary)) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--cat-color, var(--primary)); }
.cat-card:hover::before { opacity: 0.07; }
.cat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  position: relative;
  z-index: 1;
}
.cat-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
  position: relative;
  z-index: 1;
}
.cat-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  position: relative;
  z-index: 1;
}
.cat-count {
  font-size: 0.78rem;
  color: var(--cat-color, var(--primary));
  font-weight: 600;
  position: relative;
  z-index: 1;
}

/* ── TOOL CARDS GRID ── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  transition: all var(--transition);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.tool-card:hover {
  border-color: var(--primary);
  background: var(--surface-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.tool-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.tool-card-body { flex: 1; min-width: 0; }
.tool-card-body h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 4px;
}
.tool-card-body p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.tool-card-arrow {
  color: var(--text-muted);
  font-size: 0.8rem;
  flex-shrink: 0;
  margin-top: 2px;
  transition: color var(--transition);
}
.tool-card:hover .tool-card-arrow { color: var(--primary); }

/* ── TOOL PAGE LAYOUT ── */
.tool-page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  padding: 40px 0 0;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text-muted); }
.breadcrumb .current { color: var(--text); }
.tool-header-content { padding-bottom: 32px; }
.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 14px;
}
.tool-header-content h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--white);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.tool-header-content > p {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.7;
}

/* ── TOOL BOX ── */
.tool-section { padding: 48px 0; }
.tool-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 40px;
}
.tool-box h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── FORMS & INPUTS ── */
textarea, input[type="text"], input[type="number"], input[type="email"], select {
  width: 100%;
  background: var(--dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 16px;
  transition: border-color var(--transition);
  outline: none;
  resize: vertical;
}
textarea:focus, input:focus, select:focus { border-color: var(--primary); }
textarea { min-height: 140px; }
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.form-group { margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media(max-width:600px) { .form-row { grid-template-columns: 1fr; } }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); color: var(--white); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(10,108,255,0.35); }
.btn-accent { background: var(--accent); color: var(--dark); }
.btn-accent:hover { background: var(--accent-dark); color: var(--dark); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-ghost { background: var(--surface-3); color: var(--text); }
.btn-ghost:hover { background: var(--mid); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-group { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── RESULT BOX ── */
.result-box {
  background: var(--dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 60px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--text);
  word-break: break-all;
  white-space: pre-wrap;
  position: relative;
}
.result-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.copy-btn {
  background: var(--surface-3);
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}
.copy-btn:hover { background: var(--primary); color: var(--white); }

/* ── STATS ROW ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-item {
  background: var(--dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}
.stat-item strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--white);
}
.stat-item span { font-size: 0.75rem; color: var(--text-muted); }

/* ── CONTENT AREA ── */
.content-area {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
  margin-bottom: 32px;
}
.content-area h2 {
  font-size: 1.25rem;
  color: var(--white);
  margin-bottom: 12px;
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.content-area h2:first-child { margin-top: 0; }
.content-area p {
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 0.95rem;
  margin-bottom: 12px;
}
.tips-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
}
.tips-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.tips-list li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.how-to-steps { display: flex; flex-direction: column; gap: 14px; margin: 12px 0; }
.step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-heading);
}
.step-body { flex: 1; }
.step-body strong { display: block; font-size: 0.88rem; color: var(--white); margin-bottom: 3px; }
.step-body span { font-size: 0.82rem; color: var(--text-muted); }

/* ── RELATED TOOLS ── */
.related-section { padding: 40px 0; border-top: 1px solid var(--border-light); }
.related-section h2 { font-size: 1.2rem; color: var(--white); margin-bottom: 20px; }

/* ── CATEGORY PAGE ── */
.cat-page-hero {
  padding: 52px 0 40px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
}
.cat-page-hero .cat-icon-lg {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 16px;
}
.cat-page-hero h1 { font-size: 2rem; color: var(--white); margin-bottom: 10px; }
.cat-page-hero p { color: var(--text-secondary); font-size: 1rem; max-width: 520px; line-height: 1.7; }

/* ── FOOTER ── */
.site-footer {
  background: var(--dark-2);
  border-top: 1px solid var(--border-light);
  padding: 56px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border-light);
}
.footer-brand p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-top: 12px;
  max-width: 280px;
}
.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col ul a {
  font-size: 0.87rem;
  color: var(--text-muted);
  transition: color var(--transition);
}
.footer-col ul a:hover { color: var(--primary); }
.footer-bottom {
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-bottom p { font-size: 0.82rem; color: var(--text-muted); }
.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { font-size: 0.82rem; color: var(--text-muted); }
.footer-bottom-links a:hover { color: var(--primary); }

/* ── ALERTS ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.alert-success { background: rgba(0,200,150,0.1); border: 1px solid rgba(0,200,150,0.25); color: var(--accent); }
.alert-error { background: rgba(255,71,87,0.1); border: 1px solid rgba(255,71,87,0.25); color: var(--danger); }
.alert-info { background: rgba(10,108,255,0.1); border: 1px solid rgba(10,108,255,0.25); color: var(--primary); }
.alert-warning { background: rgba(255,165,2,0.1); border: 1px solid rgba(255,165,2,0.25); color: var(--warning); }

/* ── BADGE / TAG ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-primary { background: rgba(10,108,255,0.15); color: var(--primary); }
.badge-accent { background: rgba(0,200,150,0.15); color: var(--accent); }
.badge-text { background: rgba(247,147,30,0.15); color: var(--cat-text); }
.badge-seo { background: rgba(155,89,182,0.15); color: var(--cat-seo); }
.badge-calc { background: rgba(39,174,96,0.15); color: var(--cat-calc); }
.badge-conv { background: rgba(231,76,60,0.15); color: var(--cat-conv); }
.badge-dev { background: rgba(41,128,185,0.15); color: var(--cat-dev); }

/* ── DIVIDER ── */
.divider { border: none; border-top: 1px solid var(--border-light); margin: 24px 0; }

/* ── RESPONSIVE ── */
@media(max-width:900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
}
@media(max-width:600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 52px 0 40px; }
  .tool-box { padding: 20px; }
  .content-area { padding: 24px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ── UTILITY ── */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.w-full { width: 100%; }
.font-mono { font-family: 'Courier New', monospace; }

/* ── PAGE (static pages) ── */
.page-hero {
  padding: 52px 0 40px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
}
.page-hero h1 { font-size: 2rem; color: var(--white); margin-bottom: 10px; }
.page-hero p { color: var(--text-secondary); font-size: 1rem; }
.page-content { padding: 52px 0; }
.page-content h2 { font-size: 1.3rem; color: var(--white); margin-bottom: 12px; margin-top: 32px; }
.page-content h2:first-child { margin-top: 0; }
.page-content p { color: var(--text-secondary); line-height: 1.8; margin-bottom: 14px; font-size: 0.95rem; }
.page-content ul { padding-left: 20px; margin-bottom: 14px; }
.page-content ul li { color: var(--text-secondary); line-height: 1.8; font-size: 0.95rem; margin-bottom: 6px; }
.page-content a { color: var(--primary); }

/* ── SELECT STYLED ── */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236E7681' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
select option { background: var(--dark-2); color: var(--text); }

/* ── RANGE SLIDER ── */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  padding: 0;
  resize: none;
  min-height: unset;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}
