/* ================================================
   DetectorIA — Estética gifonte.com
   Monochrome · Clean · Cold · Professional
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Mono:wght@300;400;500&display=swap');

:root {
  --bg:          #090909;
  --bg-card:     #111111;
  --bg-card-alt: #0e0e0e;
  --bg-hover:    #161616;
  --border:      rgba(255,255,255,.07);
  --border-mid:  rgba(255,255,255,.12);
  --border-hi:   rgba(255,255,255,.22);

  --text:        #f0f0ee;
  --text-mid:    #888888;
  --text-dim:    #444444;

  --white:       #ffffff;
  --black:       #090909;

  --green:       #c8ff00;
  --green-dim:   rgba(200,255,0,.08);

  --font:   'Syne', sans-serif;
  --mono:   'DM Mono', monospace;

  --radius:    4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --trans:     0.18s ease;
  --trans-med: 0.3s cubic-bezier(0.16,1,0.3,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

a   { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
ul { list-style: none; }

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 2px; }

/* ─── NAVBAR ─────────────────────────────── */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; height: 52px;
  background: rgba(9,9,9,.96);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-size: .92rem; font-weight: 700; letter-spacing: -.01em;
}
.nav-logo span { font-weight: 400; color: var(--text-mid); }

.nav-links {
  display: flex; align-items: center; gap: 1.8rem;
}
.nav-links a {
  font-size: .76rem; font-weight: 500;
  color: var(--text-mid); letter-spacing: .04em;
  transition: color var(--trans);
}
.nav-links a:hover { color: var(--white); }

/* ─── HERO ───────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 100px 2rem 5rem;
  max-width: 1100px; margin: 0 auto;
}

.hero-tag {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--mono); font-size: .7rem;
  color: var(--text-dim); letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: 2rem;
}
.hero-tag::before {
  content: ''; width: 18px; height: 1px; background: var(--text-dim);
}

.hero-title {
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 800; line-height: .95;
  letter-spacing: -.04em; text-transform: uppercase;
  margin-bottom: 1.8rem;
}
.hero-title em {
  font-style: italic; font-weight: 400; color: var(--text-mid);
}

.hero-desc {
  font-size: .95rem; color: var(--text-mid);
  max-width: 420px; line-height: 1.75; margin-bottom: 2rem;
}

.hero-actions {
  display: flex; gap: .6rem; align-items: center; flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .65rem 1.5rem;
  background: var(--white); color: var(--black);
  font-family: var(--font); font-weight: 700; font-size: .78rem;
  letter-spacing: .06em; text-transform: uppercase;
  border-radius: var(--radius);
  transition: opacity var(--trans);
}
.btn-primary:hover { opacity: .86; }

.btn-ghost {
  display: inline-flex; align-items: center;
  padding: .65rem 1.3rem;
  border: 1px solid var(--border-mid); color: var(--text-mid);
  font-size: .78rem; letter-spacing: .04em; text-transform: uppercase;
  border-radius: var(--radius);
  transition: border-color var(--trans), color var(--trans);
}
.btn-ghost:hover { border-color: var(--border-hi); color: var(--text); }

.hero-stats {
  display: flex; margin-top: 3.5rem;
  border-top: 1px solid var(--border); padding-top: 2rem;
}
.hero-stat {
  padding-right: 2.5rem; margin-right: 2.5rem;
  border-right: 1px solid var(--border);
}
.hero-stat:last-child { border-right: none; padding-right: 0; margin-right: 0; }
.hero-stat-num {
  font-family: var(--mono); font-size: 1.7rem; font-weight: 400;
  line-height: 1; margin-bottom: .25rem;
}
.hero-stat-label {
  font-family: var(--mono); font-size: .65rem; color: var(--text-dim);
  letter-spacing: .1em; text-transform: uppercase;
}

/* ─── SHARED SECTION WRAPPER ─────────────── */
.section-wrap {
  max-width: 1100px; margin: 0 auto;
  padding: 5rem 2rem;
  border-top: 1px solid var(--border);
}

.section-label {
  font-family: var(--mono); font-size: .68rem;
  color: var(--text-dim); letter-spacing: .14em; text-transform: uppercase;
  margin-bottom: .8rem;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800; line-height: 1;
  letter-spacing: -.03em; text-transform: uppercase;
  margin-bottom: .6rem;
}

.section-desc {
  font-size: .88rem; color: var(--text-mid);
  max-width: 460px; line-height: 1.7;
}

/* ─── DETECTOR ───────────────────────────── */
#detector {
  max-width: 1100px; margin: 0 auto;
  padding: 5rem 2rem;
  border-top: 1px solid var(--border);
}

.tool-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.8rem;
}

.mode-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .22rem .65rem;
  border: 1px solid var(--border-mid); border-radius: var(--radius);
  font-family: var(--mono); font-size: .66rem; color: var(--text-mid);
}
.mode-badge.mode-ai { border-color: rgba(200,255,0,.3); color: var(--green); }
.mode-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.mode-dot.pulse { animation: pdot 2s ease-in-out infinite; }
@keyframes pdot { 0%,100%{opacity:1}50%{opacity:.25} }

.tool-body {
  display: grid; grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; min-height: 520px;
}

/* Input panel */
.input-panel {
  padding: 1.4rem;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: .8rem;
  background: var(--bg-card-alt);
}

.panel-header {
  font-family: var(--mono); font-size: .66rem; color: var(--text-dim);
  letter-spacing: .12em; text-transform: uppercase;
}

.textarea-wrap {
  flex: 1; display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; background: var(--bg);
  transition: border-color var(--trans-med);
}
.textarea-wrap:focus-within { border-color: var(--border-hi); }

#text-input {
  flex: 1; min-height: 300px;
  padding: 1.1rem;
  background: transparent; border: none;
  color: var(--text); font-family: var(--font); font-size: .86rem; line-height: 1.75;
  resize: none; outline: none;
}
#text-input::placeholder { color: var(--text-dim); font-size: .82rem; }

.textarea-footer {
  padding: .5rem .9rem;
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--border);
}
.word-stats {
  display: flex; gap: .35rem;
  font-family: var(--mono); font-size: .67rem; color: var(--text-dim);
}
.word-sep { opacity: .3; }
#word-count.ready { color: var(--text-mid); }
.kbhint { font-family: var(--mono); font-size: .65rem; color: var(--text-dim); opacity: .4; }

.action-bar { display: flex; gap: .5rem; }

.btn-analyze {
  flex: 1; padding: .65rem 1.2rem;
  background: var(--white); color: var(--black);
  font-family: var(--font); font-weight: 700; font-size: .76rem;
  letter-spacing: .07em; text-transform: uppercase;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  transition: opacity var(--trans);
}
.btn-analyze:hover:not(:disabled) { opacity: .85; }
.btn-analyze:disabled { opacity: .3; cursor: not-allowed; }
.btn-analyze-content,
.btn-analyze-loading { display: flex; align-items: center; gap: .4rem; }

.btn-clear {
  padding: .65rem .85rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: var(--mono); font-size: .72rem; color: var(--text-dim);
  transition: border-color var(--trans), color var(--trans);
}
.btn-clear:hover { border-color: var(--border-hi); color: var(--text-mid); }

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .7s linear infinite; }

.analysis-status {
  padding: .55rem .85rem;
  border: 1px solid var(--border-mid); border-radius: var(--radius);
  font-family: var(--mono); font-size: .7rem; color: var(--text-mid);
}

.error-msg {
  padding: .55rem .85rem;
  border: 1px solid rgba(255,80,80,.2); border-radius: var(--radius);
  font-family: var(--mono); font-size: .7rem; color: #ff7070;
  background: rgba(255,80,80,.06);
}

/* Result panel */
.result-panel {
  padding: 1.4rem; display: flex; flex-direction: column; gap: 1.3rem;
  overflow-y: auto; max-height: 80vh; background: var(--bg-card);
}

.result-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .4rem; text-align: center;
}
.result-empty-icon { font-size: 1.8rem; opacity: .15; margin-bottom: .3rem; }
.result-empty p {
  font-family: var(--mono); font-size: .7rem; color: var(--text-dim);
  letter-spacing: .05em; line-height: 1.65;
}

/* Score block */
.score-row {
  display: flex; align-items: center; gap: 1.2rem;
  padding-bottom: 1.3rem; border-bottom: 1px solid var(--border);
}

.score-ring-wrap {
  position: relative; flex-shrink: 0; width: 96px; height: 96px;
}
.score-ring { width: 96px; height: 96px; transform: rotate(-90deg); }
.ring-track   { fill: none; stroke: rgba(255,255,255,.04); stroke-width: 7; }
.ring-progress {
  fill: none; stroke: var(--white); stroke-width: 7;
  stroke-linecap: butt;
  stroke-dasharray: 289;
  stroke-dashoffset: 289;
  transition: stroke-dashoffset 1s cubic-bezier(.16,1,.3,1), stroke .4s;
}
.score-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score-number {
  font-family: var(--mono); font-size: 1.55rem; font-weight: 400; line-height: 1;
}
.score-unit {
  font-family: var(--mono); font-size: .6rem; color: var(--text-dim); letter-spacing: .06em;
}

.score-meta { flex: 1; min-width: 0; }

.verdict-tag {
  display: inline-block; padding: .18rem .6rem;
  border: 1px solid var(--border-mid); border-radius: var(--radius);
  font-family: var(--mono); font-size: .66rem; font-weight: 500;
  letter-spacing: .07em; text-transform: uppercase; margin-bottom: .5rem;
}
.verdict-tag.human { border-color: rgba(255,255,255,.2); color: var(--text); }
.verdict-tag.mixed { border-color: rgba(255,215,64,.3); color: #ffd740; }
.verdict-tag.ai    { border-color: rgba(255,80,80,.35); color: #ff6464; }

.result-title {
  font-size: .86rem; font-weight: 700; margin-bottom: .3rem; line-height: 1.3;
}
.result-explanation {
  font-size: .76rem; color: var(--text-mid); line-height: 1.65;
}

.score-breakdown {
  margin-top: .65rem; display: flex; flex-direction: column; gap: .12rem;
}
.breakdown-row {
  display: flex; gap: .4rem;
  font-family: var(--mono); font-size: .66rem;
}
.breakdown-lbl { color: var(--text-dim); }
.breakdown-val { color: var(--text-mid); }

/* Panel label */
.plabel {
  font-family: var(--mono); font-size: .66rem;
  color: var(--text-dim); letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: .65rem;
}

/* Metrics */
.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }

.metric-card {
  padding: .65rem;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg);
}
.metric-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .3rem;
}
.metric-name { font-family: var(--mono); font-size: .65rem; color: var(--text-mid); }
.metric-val  { font-family: var(--mono); font-size: .68rem; font-weight: 500; }
.metric-bar  {
  height: 2px; background: rgba(255,255,255,.05);
  border-radius: 1px; margin-bottom: .28rem; overflow: hidden;
}
.metric-fill {
  height: 100%; width: 0%;
  background: rgba(255,255,255,.55);
  transition: width .9s cubic-bezier(.16,1,.3,1);
}
.metric-fill.human-fill { background: rgba(255,255,255,.3); }
.metric-hint { font-family: var(--mono); font-size: .6rem; color: var(--text-dim); }

/* Heatmap */
.legend-row {
  display: flex; gap: .75rem; margin-bottom: .55rem;
}
.legend-item {
  display: flex; align-items: center; gap: .3rem;
  font-family: var(--mono); font-size: .64rem; color: var(--text-dim);
}
.ldot { width: 10px; height: 2px; border-radius: 1px; }
.ld-human { background: rgba(255,255,255,.3); }
.ld-mixed { background: rgba(255,215,64,.5); }
.ld-ai    { background: rgba(255,80,80,.65); }

.sentence-heatmap {
  font-size: .82rem; line-height: 1.95; color: var(--text-mid);
}
.sentence-heatmap span { padding: 0 1px; border-radius: 2px; }
.s-human { color: var(--text); border-bottom: 1.5px solid rgba(255,255,255,.18); }
.s-mixed { color: #e8d070; border-bottom: 1.5px solid rgba(255,215,64,.3); }
.s-ai    { color: #ff8080; border-bottom: 1.5px solid rgba(255,80,80,.5); background: rgba(255,60,60,.04); }

.disclaimer {
  font-family: var(--mono); font-size: .64rem; color: var(--text-dim);
  padding: .65rem; border: 1px solid var(--border); border-radius: var(--radius-md);
  line-height: 1.6;
}
.disclaimer a { color: var(--text-mid); text-decoration: underline; }

/* ─── HOW IT WORKS ───────────────────────── */
.steps-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; margin-top: 2rem;
}
.step-card {
  padding: 1.6rem 1.4rem;
  border-right: 1px solid var(--border);
  transition: background var(--trans);
}
.step-card:last-child { border-right: none; }
.step-card:hover { background: var(--bg-hover); }
.step-num {
  font-family: var(--mono); font-size: .66rem; color: var(--text-dim);
  letter-spacing: .05em; margin-bottom: .8rem;
}
.step-card h3 { font-size: .86rem; font-weight: 700; margin-bottom: .4rem; }
.step-card p  { font-size: .76rem; color: var(--text-mid); line-height: 1.65; }

/* ─── FAQ ────────────────────────────────── */
.faq-list {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; margin-top: 2rem;
}
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }

.faq-q {
  width: 100%; text-align: left;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.3rem;
  font-size: .84rem; font-weight: 600; gap: 1rem;
  transition: background var(--trans);
}
.faq-q:hover { background: var(--bg-hover); }

.faq-icon {
  font-family: var(--mono); font-size: .95rem; font-weight: 300;
  color: var(--text-dim); flex-shrink: 0;
  transition: transform var(--trans);
}
.faq-item.open .faq-icon { transform: rotate(45deg); }

.faq-a {
  max-height: 0; overflow: hidden;
  transition: max-height .35s cubic-bezier(.16,1,.3,1), padding var(--trans);
  font-size: .8rem; color: var(--text-mid); line-height: 1.7;
  padding: 0 1.3rem;
}
.faq-a a { color: var(--text); text-decoration: underline; }
.faq-item.open .faq-a { max-height: 300px; padding: .2rem 1.3rem 1.1rem; }

/* ─── FOOTER ─────────────────────────────── */
footer {
  border-top: 1px solid var(--border); padding: 2.5rem 2rem;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 2rem; flex-wrap: wrap;
}
.footer-logo { font-size: .9rem; font-weight: 700; margin-bottom: .25rem; }
.footer-brand p {
  font-family: var(--mono); font-size: .67rem;
  color: var(--text-dim); line-height: 1.6;
}
.footer-col { display: flex; flex-direction: column; gap: .3rem; }
.footer-col h4 {
  font-family: var(--mono); font-size: .62rem;
  color: var(--text-dim); letter-spacing: .1em; text-transform: uppercase;
  margin-bottom: .5rem;
}
.footer-col a {
  font-size: .76rem; color: var(--text-mid);
  transition: color var(--trans);
}
.footer-col a:hover { color: var(--white); }
.footer-copy {
  font-family: var(--mono); font-size: .65rem;
  color: var(--text-dim); margin-top: .5rem;
}

/* ─── RESPONSIVE ─────────────────────────── */
@media (max-width: 860px) {
  .tool-body { grid-template-columns: 1fr; min-height: unset; }
  .input-panel { border-right: none; border-bottom: 1px solid var(--border); }
  .result-panel { max-height: unset; }
  .steps-grid { grid-template-columns: 1fr 1fr; }
  .step-card:nth-child(2) { border-right: none; }
  .step-card:nth-child(3) { border-right: 1px solid var(--border); }
  .step-card { border-bottom: 1px solid var(--border); }
  .step-card:last-child { border-bottom: none; }
}

@media (max-width: 600px) {
  #navbar { padding: 0 1rem; }
  .nav-links a:not(:last-child):not(:nth-last-child(2)) { display: none; }
  .hero-title { font-size: clamp(2.8rem, 12vw, 3.5rem); }
  .hero-stats { flex-direction: column; gap: .8rem; }
  .hero-stat { border-right: none; border-bottom: 1px solid var(--border); padding-bottom: .8rem; margin-right: 0; padding-right: 0; }
  .hero-stat:last-child { border-bottom: none; }
  .steps-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
}
