/* ================================================================
   Izzat Tools — CSS compartilhado por todas as 97 ferramentas nativas.
   Carrega em todas as tools/<slug>.html via <link rel="stylesheet">.
================================================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --black: #1d1d1f;
  --gray-body: #6e6e73;
  --gray-light: #86868b;
  --gray-bg: #f5f5f7;
  --gray-card: #f5f5f7;
  --white: #ffffff;
  --accent: #FF6A00;
  --accent-alt: #ed742e;
  --accent-hover: #e55d00;
  --link: #0066CC;
  --border: rgba(0,0,0,0.08);
  --border-soft: rgba(0,0,0,0.06);
  --ease-apple: cubic-bezier(0.28, 0.11, 0.32, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --tool-accent: var(--accent);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
}
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font); background: var(--white); color: var(--black); line-height: 1.47059; font-size: 17px; overflow-x: hidden; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ============ GNAV (padrao do index.html) ============ */
.gnav {
  position: sticky; top: 0; z-index: 9999; height: 44px;
  background: rgba(255,255,255,0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.35s var(--ease-apple), background 0.3s, border-color 0.3s;
}
.gnav--scrolled { background: rgba(255,255,255,0.88); border-bottom-color: rgba(0,0,0,0.12); }
.gnav--hidden { transform: translateY(-100%); }
.gnav__inner { display: flex; align-items: center; justify-content: space-between; max-width: 980px; height: 100%; margin: 0 auto; padding: 0 22px; }
.gnav__logo { display: flex; align-items: center; color: var(--black); }
.gnav__logo svg { height: 16px; opacity: 0.8; }
.gnav__links { display: flex; gap: 28px; align-items: center; }
.gnav__link { font-size: 12px; color: var(--black); opacity: 0.56; transition: opacity 0.2s; position: relative; }
.gnav__link:hover { opacity: 1; text-decoration: none; }
.gnav__link::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform 0.3s var(--ease-out); }
.gnav__link:hover::after { transform: scaleX(1); transform-origin: left; }
.gnav__link[aria-current="page"] { opacity: 1; color: var(--accent); }
.gnav__search { opacity: 0.56; color: var(--black); transition: opacity 0.2s; display: flex; align-items: center; }
.gnav__search:hover { opacity: 1; }
.gnav__hamburger { display: none; width: 20px; height: 20px; flex-direction: column; justify-content: center; gap: 4px; background: none; border: none; cursor: pointer; }
.gnav__hamburger span { display: block; width: 18px; height: 1.5px; background: var(--black); }
.gnav__drawer { display: none; position: fixed; top: 44px; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.55); backdrop-filter: saturate(180%) blur(28px); -webkit-backdrop-filter: saturate(180%) blur(28px); z-index: 9998; flex-direction: column; padding: 32px 24px; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .gnav__drawer { background: rgba(255,255,255,0.98); } }
.gnav__drawer.open { display: flex; }
.gnav__drawer a { font-size: 28px; font-weight: 500; padding: 12px 0; border-bottom: 1px solid var(--border-soft); letter-spacing: -0.02em; color: var(--black); }
.gnav__drawer a:hover { color: var(--accent); text-decoration: none; }
@media (max-width: 833px) {
  .gnav__links { display: none; }
  .gnav__hamburger { display: flex; order: 3; }
  .gnav__inner { position: relative; }
  .gnav__logo { position: absolute; left: 50%; transform: translateX(-50%); }
  .gnav__search { order: 1; }
}

/* ============ TOOL PAGE LAYOUT ============ */
.tool-wrap { max-width: 980px; margin: 0 auto; padding: 0 22px; }
.tool-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--gray-body);
  margin: 48px 0 28px; text-decoration: none;
  transition: color 0.2s;
}
.tool-back:hover { color: var(--accent); text-decoration: none; }

.tool-hero__head { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 40px; }
.tool-hero__icon-wrap {
  flex-shrink: 0; width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  color: var(--tool-accent);
}
.tool-hero__icon-wrap svg { width: 40px; height: 40px; }
.tool-hero__meta { flex: 1; }
.tool-hero__cat {
  display: inline-block; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--tool-accent); margin-bottom: 8px;
}
.tool-hero__title {
  font-size: clamp(32px, 5vw, 44px); font-weight: 600;
  letter-spacing: -0.03em; line-height: 1.08;
  color: var(--black); margin-bottom: 10px;
}
.tool-hero__tagline {
  font-size: clamp(16px, 1.6vw, 19px); color: var(--gray-body);
  line-height: 1.45; max-width: 720px;
}

/* ============ TOOL BODY (form + result) ============ */
.tool-body {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  margin: 0 auto 40px;
}
@media (max-width: 833px) { .tool-body { grid-template-columns: 1fr; } }

.tool-panel {
  background: var(--gray-card); border-radius: 18px;
  padding: 24px;
}
.tool-panel h2 {
  font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--gray-light);
  margin-bottom: 16px;
}
.tool-panel--result { background: #0a0a0a; color: #fff; }
.tool-panel--result h2 { color: rgba(255,255,255,0.5); }

/* ============ FORM CONTROLS ============ */
.field { display: block; margin-bottom: 16px; }
.field__label { display: block; font-size: 13px; font-weight: 500; color: var(--gray-body); margin-bottom: 6px; }
.field__help { font-size: 12px; color: var(--gray-light); margin-top: 4px; }
.field__input, .field__select, .field__textarea {
  width: 100%; padding: 11px 14px; border-radius: 10px;
  font-size: 15px; font-family: inherit;
  background: #fff; border: 1px solid var(--border);
  color: var(--black); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field__textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.field__input:focus, .field__select:focus, .field__textarea:focus {
  border-color: var(--tool-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tool-accent) 18%, transparent);
}
.field--prefix { position: relative; }
.field--prefix .field__prefix {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: var(--gray-light); pointer-events: none;
}
.field--prefix .field__input { padding-left: 38px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

.field__check {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 10px; background: #fff; border: 1px solid var(--border);
  cursor: pointer; transition: border-color 0.2s;
  font-size: 14px; color: var(--black);
  margin-bottom: 8px;
}
.field__check:hover { border-color: var(--tool-accent); }
.field__check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--tool-accent); cursor: pointer; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  font-size: 14px; font-weight: 600;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  cursor: pointer; border: none;
  font-family: inherit;
}
.btn--primary { background: var(--tool-accent); color: #fff !important; text-decoration: none !important; }
.btn--primary:hover { background: color-mix(in srgb, var(--tool-accent) 85%, black); }
.btn--black { background: var(--black); color: #fff !important; text-decoration: none !important; }
.btn--black:hover { background: var(--tool-accent); }
.btn--ghost { background: #fff; color: var(--black); border: 1px solid var(--border); }
.btn--ghost:hover { border-color: var(--black); }
.btn--ghost-light { background: rgba(255,255,255,0.08); color: #fff; border: 1px solid rgba(255,255,255,0.15); }
.btn--ghost-light:hover { background: rgba(255,255,255,0.14); }
.btn--full { width: 100%; }
.btn:active { transform: translateY(1px); }

/* ============ RESULT DISPLAY ============ */
.result {
  padding: 18px 16px; border-radius: 12px;
  background: rgba(255,255,255,0.05);
  margin-bottom: 14px;
}
.result__label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.5); margin-bottom: 6px; }
.result__value { font-size: clamp(24px, 4vw, 36px); font-weight: 700; letter-spacing: -0.02em; color: #fff; line-height: 1.05; }
.result__value--accent { color: var(--tool-accent); }
.result__value--big { font-size: clamp(40px, 7vw, 64px); }
.result__sub { font-size: 13px; color: rgba(255,255,255,0.55); margin-top: 6px; }
.result__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.result__grid .result { margin-bottom: 0; }
.result__divider { height: 1px; background: rgba(255,255,255,0.1); margin: 12px 0; }
.result--inline { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.result--inline .result__label { margin: 0; }
.result--inline .result__value { font-size: 20px; }

/* Result output box (p/ copy) */
.output {
  background: #fff; color: var(--black);
  border-radius: 10px; padding: 14px;
  font-family: ui-monospace, 'SF Mono', Menlo, Monaco, Consolas, monospace;
  font-size: 13px; line-height: 1.55;
  word-break: break-word; overflow-wrap: anywhere; white-space: pre-wrap;
  max-height: 260px; overflow-y: auto; overflow-x: hidden;
  margin-bottom: 10px;
  border: 1px solid rgba(0,0,0,0.08);
  min-height: 56px;
}
.output:empty { min-height: 0; padding: 0; border: none; background: transparent; }
.output--plain { font-family: inherit; word-break: normal; overflow-wrap: normal; font-size: 14px; line-height: 1.6; }
.output--preview { min-height: 200px; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--gray-light); }
.output--preview img, .output--preview canvas { max-width: 100%; height: auto; border-radius: 6px; }
.output--html { white-space: normal; word-break: normal; max-height: none; }
.output--html img, .output--html canvas, .output--html svg { max-width: 100%; height: auto; }
.output--html table { max-width: 100%; width: 100%; border-collapse: collapse; }
.output-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Dark panel: textos placeholder inline ficam legiveis */
.tool-panel--result [style*="var(--gray-light)"],
.tool-panel--result [style*="#86868b"],
.tool-panel--result [style*="#6e6e73"] { color: rgba(255,255,255,0.5) !important; }
.tool-panel--result .result p,
.tool-panel--result > p,
.tool-panel--result .empty-state { color: rgba(255,255,255,0.6); font-size: 13px; }

/* Garante quebra de linha em URLs/strings longas dentro do painel preto */
.tool-panel--result .result__value { word-break: break-word; overflow-wrap: anywhere; }

/* ============ TABS ============ */
.tool-tabs { display: flex; gap: 4px; background: rgba(0,0,0,0.04); border-radius: 10px; padding: 4px; margin-bottom: 16px; }
.tool-tab {
  flex: 1; padding: 9px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  background: none; color: var(--gray-body); border: none; cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
}
.tool-tab.is-active { background: #fff; color: var(--black); box-shadow: 0 1px 3px rgba(0,0,0,0.05); }

/* ============ NOTICE / INFO ============ */
.notice {
  padding: 14px 16px; border-radius: 12px;
  background: color-mix(in srgb, var(--tool-accent) 8%, transparent);
  color: var(--black); font-size: 13px; line-height: 1.5;
  border: 1px solid color-mix(in srgb, var(--tool-accent) 18%, transparent);
  margin-bottom: 16px;
}
.notice strong { color: var(--tool-accent); }

/* ============ CONTEXT (Sobre + Use cases) ============ */
.tool-context {
  padding: 48px 0 56px;
  display: grid; grid-template-columns: 2fr 1fr; gap: 40px;
}
@media (max-width: 833px) { .tool-context { grid-template-columns: 1fr; gap: 24px; } }
.tool-context__col h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: var(--black); margin-bottom: 12px; }
.tool-context__col h2:not(:first-child) { margin-top: 28px; }
.tool-context__col p { font-size: 15px; line-height: 1.6; color: var(--gray-body); margin-bottom: 14px; }
.tool-context__col ul { list-style: none; }
.tool-context__col li {
  font-size: 14px; line-height: 1.6; color: var(--gray-body);
  padding: 8px 0 8px 22px; position: relative;
  border-bottom: 1px solid var(--border-soft);
}
.tool-context__col li:last-child { border-bottom: none; }
.tool-context__col li::before {
  content: ''; position: absolute; left: 0; top: 15px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--tool-accent);
}
.tool-related { background: var(--gray-card); border-radius: 14px; padding: 20px; }
.tool-related h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray-light); margin-bottom: 14px; }
.tool-related ul { list-style: none; }
.tool-related li { margin-bottom: 8px; }
.tool-related a {
  display: block; padding: 8px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--black);
  background: #fff;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}
.tool-related a:hover { background: var(--black); color: #fff; }

/* ============ CTA + FOOTER ============ */
.tool-cta { background: #000; color: #fff; text-align: center; padding: 56px 24px; }
.tool-cta__title { font-size: clamp(24px, 3.5vw, 36px); font-weight: 600; letter-spacing: -0.02em; margin-bottom: 12px; }
.tool-cta__sub { font-size: 15px; color: rgba(255,255,255,0.62); max-width: 460px; margin: 0 auto 22px; }
.tool-cta .btn--primary { background: var(--accent); }

.footer { background: var(--gray-bg); padding: 20px 0 0; font-size: 12px; color: var(--gray-light); }
.footer__inner { max-width: 980px; margin: 0 auto; padding: 0 22px; }
.footer__bottom { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; flex-wrap: wrap; gap: 8px; }
.footer__legal { display: flex; gap: 16px; flex-wrap: wrap; }
.footer__legal a { font-size: 12px; color: var(--gray-light); text-decoration: none; }
.footer__legal a:hover { color: var(--black); text-decoration: underline; }

/* ============ ANIMATIONS ============ */
.anim { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease-apple), transform 0.6s var(--ease-apple); }
.anim.in { opacity: 1; transform: none; }

/* ============ TOAST ============ */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(40px);
  padding: 12px 20px; border-radius: 999px;
  background: var(--black); color: #fff;
  font-size: 13px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 10000;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
