:root {
  --bg: #eef3f6;
  --bg-soft: #f7fafc;
  --surface: #ffffff;
  --surface-2: #f3f7f9;
  --text: #16202a;
  --text-muted: #5e6a75;
  --text-faint: #8b96a1;
  --primary: #0d6b72;
  --primary-dark: #0a5459;
  --primary-soft: #dcebed;
  --border: rgba(20, 28, 34, 0.1);
  --divider: rgba(20, 28, 34, 0.08);
  --danger: #a33d56;
  --success: #1f7a4c;
  --shadow-sm: 0 6px 18px rgba(17, 24, 39, 0.06);
  --shadow-md: 0 20px 50px rgba(17, 24, 39, 0.12);
  --radius-sm: 0.75rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-xl: 1.75rem;
  --font-display: "Cabinet Grotesk", "Inter", sans-serif;
  --font-body: "Satoshi", "Inter", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(13, 107, 114, 0.08), transparent 28%),
    linear-gradient(180deg, var(--bg), #e9eff3);
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  background: none;
}

textarea {
  resize: none;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 50;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: var(--primary);
  color: #fff;
}

.skip-link:focus {
  top: 1rem;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.shell {
  width: min(calc(100% - 48px), 1300px);
  margin-inline: auto;
}

.site-header {
  height: 64px;
  border-bottom: 1px solid var(--divider);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-logo {
  height: 38px;
  width: auto;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.06));
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--text), #294552);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.2;
}

.brand-copy {
  display: grid;
  gap: 0.1rem;
}

.brand-copy strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.brand-copy small {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.header-badge {
  min-height: 42px;
  padding: 0 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-muted);
  font-size: 0.92rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link.active {
  color: var(--text);
  font-weight: 700;
}

.page-main {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  padding-block: 2rem;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: start;
  padding-block: 2rem;
}

.hero-copy {
  align-self: center;
  padding-top: 1rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  max-width: 20ch;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.hero-text {
  margin: 1.25rem 0 0;
  max-width: 50ch;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

.hero-points {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.point-card {
  min-height: 120px;
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.point-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.point-card strong {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
}

.point-card span {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.analyzer-panel {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 1.5rem;
}

.panel-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-kicker {
  margin: 0 0 0.3rem;
  color: var(--text-faint);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.panel-top h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.panel-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: right;
}

.mode-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.mode-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 0.95rem;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  transition: 0.18s ease;
}

.mode-btn:hover {
  background: #eef4f6;
}

.mode-btn.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.mode-icon {
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 0.5rem;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
  font-weight: 800;
}

.mode-panel {
  display: grid;
  gap: 0.7rem;
}

.field-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
}

.field-head label {
  font-size: 0.9rem;
  font-weight: 700;
}

.field-meta {
  color: var(--text-faint);
  font-size: 0.8rem;
}

#textInput {
  width: 100%;
  height: 120px;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: #fff;
  color: var(--text);
}

#textInput::placeholder {
  color: var(--text-faint);
}

#textInput:focus {
  outline: none;
  border-color: rgba(13, 107, 114, 0.45);
  box-shadow: 0 0 0 4px rgba(13, 107, 114, 0.1);
}

.helper-text {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.upload-zone {
  min-height: 120px;
  padding: 1rem;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.8rem;
  border: 1.5px dashed rgba(22, 32, 42, 0.16);
  border-radius: 1rem;
  background: #fff;
  text-align: center;
  cursor: pointer;
  transition: 0.18s ease;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: #f6fbfb;
}

.upload-illustration {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 1rem;
  background: var(--primary-soft);
  color: var(--primary);
}

.upload-illustration svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
}

.upload-copy strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.9rem;
}

.upload-copy p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.file-upload {
  display: none;
}

.file-name-display {
  display: none;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.file-name-display.show {
  display: block;
}

.scan-btn {
  width: 100%;
  min-height: 46px;
  margin-top: 0.9rem;
  border-radius: 1rem;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.scan-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(13, 107, 114, 0.25);
}

.scan-btn:disabled {
  opacity: 0.75;
  cursor: wait;
}

.error-message {
  display: none;
  margin-top: 0.8rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(163, 61, 86, 0.24);
  border-radius: 0.9rem;
  background: rgba(163, 61, 86, 0.08);
  color: var(--danger);
  font-size: 0.9rem;
}

.error-message.show {
  display: block;
}

.results-shell {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--divider);
}

.results-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.results-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.results-head span {
  color: var(--text-faint);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.results-container {
  min-height: 70px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: #fff;
  transition: min-height 0.3s ease;
}

.results-container:empty::before {
  content: "Aquí aparecerá el resultado del análisis.";
  color: var(--text-faint);
  font-size: 0.85rem;
}

.result-card {
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1rem;
}

.result-card.ai {
  border-color: rgba(163, 61, 86, 0.18);
  background: rgba(163, 61, 86, 0.05);
}

.result-card.human {
  border-color: rgba(31, 122, 76, 0.18);
  background: rgba(31, 122, 76, 0.05);
}

.result-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.result-badge {
  width: 48px;
  height: 48px;
  border-radius: 0.95rem;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  font-weight: 700;
}

.result-badge.ai {
  background: rgba(163, 61, 86, 0.12);
  color: var(--danger);
}

.result-badge.human {
  background: rgba(31, 122, 76, 0.12);
  color: var(--success);
}

.result-text h2 {
  margin: 0 0 0.2rem;
  font-size: 1.1rem;
}

.result-text p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.confidence-section {
  display: grid;
  gap: 0.45rem;
}

.confidence-label {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.confidence-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e8edf1;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  border-radius: 999px;
}

.confidence-fill.ai {
  background: linear-gradient(90deg, #c95b7e, #a33d56);
}

.confidence-fill.human {
  background: linear-gradient(90deg, #35a164, #1f7a4c);
}

.confidence-value {
  font-weight: 700;
  font-size: 0.94rem;
}

.result-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 1080px) {
  .page-main {
    min-height: auto;
    align-items: start;
  }

  .hero-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-block: 1.5rem 2rem;
  }

  .hero-copy h1 {
    max-width: 18ch;
  }

  .hero-points {
    grid-template-columns: repeat(3, 1fr);
  }

  .analyzer-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .site-header {
    height: auto;
  }

  .header-inner,
  .panel-top,
  .results-head,
  .field-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-inner {
    padding: 14px 0;
  }

  .header-badge {
    display: none;
  }

  .brand-copy small {
    display: none;
  }

  .brand-logo {
    height: 32px;
  }

  .mode-selector {
    grid-template-columns: 1fr;
  }

  .hero-points {
    grid-template-columns: 1fr;
  }

  #textInput,
  .upload-zone {
    min-height: 140px;
  }
}