/* ==============================================================
   TALLER AGENTES DE IA - HERMES & ANTIGRAVITY | ESTILOS PRINCIPALES
   ============================================================== */

:root {
  --bg-main: #0a0d14;
  --bg-card: #111724;
  --bg-card-hover: #161e30;
  --bg-input: #0e131f;
  --border-color: #1e283d;
  --border-focus: #06b6d4;
  --border-accent: rgba(6, 182, 212, 0.35);

  --text-main: #f3f4f6;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.45), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(6, 182, 212, 0.18);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Fondo con efecto sutil de ingeniería */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(59, 130, 246, 0.08) 0%, transparent 45%),
    linear-gradient(to right, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.site-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  position: relative;
  z-index: 1;
}

/* ==============================================================
   HEADER
   ============================================================== */
.header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan);
  border: 1px solid var(--border-accent);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  width: fit-content;
}

.main-title {
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.counter-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-main);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* ==============================================================
   QUOTE BANNER
   ============================================================== */
.quote-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.08) 0%, rgba(59, 130, 246, 0.04) 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.6rem;
  margin-bottom: 2rem;
}

.quote-icon {
  font-size: 2rem;
  background: rgba(6, 182, 212, 0.15);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quote-highlight {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.2rem;
}

.quote-body p {
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* ==============================================================
   CARDS & GRID
   ============================================================== */
.grid-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 900px) {
  .grid-main {
    grid-template-columns: 1.05fr 1.15fr;
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.8rem;
  box-shadow: var(--shadow-card);
  position: relative;
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.card-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ==============================================================
   FORMULARIOS ACCESIBLES
   ============================================================== */
.form-flow {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.req {
  color: var(--accent-rose);
  margin-left: 2px;
}

.form-group input {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.form-group input:focus-visible {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

.form-group input:user-invalid {
  border-color: var(--accent-rose);
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.field-error {
  font-size: 0.78rem;
  color: var(--accent-rose);
  min-height: 1rem;
  display: block;
}

.form-status {
  min-height: 1.2rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.form-status.error {
  padding: 0.6rem 0.8rem;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fda4af;
}

.form-status.success {
  padding: 0.6rem 0.8rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

/* ==============================================================
   ESTADO YA REGISTRADO
   ============================================================== */
.registered-state {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.registered-state.hidden {
  display: none;
}

.form-flow.hidden {
  display: none;
}

.success-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 1rem;
  border-radius: var(--radius-md);
}

.check-circle {
  width: 36px;
  height: 36px;
  background: var(--accent-emerald);
  color: #042f1a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.success-banner h3 {
  font-size: 1rem;
  color: #a7f3d0;
  font-weight: 700;
}

.success-banner p {
  font-size: 0.84rem;
  color: #d1fae5;
}

.student-info-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
}

.info-label {
  color: var(--text-dim);
}

.info-value {
  color: var(--text-main);
  font-weight: 600;
}

.font-mono {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

/* ==============================================================
   CENTRO DE DESCARGAS
   ============================================================== */
.download-items-grid {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.download-item-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.3rem;
  position: relative;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.download-item-box:hover {
  border-color: rgba(6, 182, 212, 0.4);
}

.download-item-box.featured {
  border-color: var(--border-accent);
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.05) 0%, rgba(14, 19, 31, 0.95) 100%);
  box-shadow: var(--shadow-glow);
}

.item-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid var(--border-accent);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  text-transform: uppercase;
}

.item-title-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.icon-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.hermes-color {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.antigravity-color {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.item-title-row h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.item-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
  display: block;
}

.item-description {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
  line-height: 1.45;
}

.bundle-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.folder-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.item-actions-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

@media (max-width: 480px) {
  .item-actions-dual {
    grid-template-columns: 1fr;
  }
}

/* Api Keys Box */
.api-keys-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.api-keys-header {
  margin-bottom: 0.6rem;
}

.api-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.api-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.15s ease;
}

.chip-link strong {
  color: var(--accent-cyan);
  margin-right: 0.3rem;
}

.chip-link:hover {
  border-color: var(--border-focus);
  color: #fff;
  transform: translateY(-1px);
}

/* ==============================================================
   BOTONES
   ============================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
}

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #ffffff;
  border-color: rgba(14, 165, 233, 0.5);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.35);
}

.btn-download {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.btn-download:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--text-dim);
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-color);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ==============================================================
   SECCIÓN DE INSTRUCCIONES
   ============================================================== */
.instructions-section {
  margin-top: 1rem;
}

.steps-flow {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}

@media (min-width: 768px) {
  .steps-flow {
    grid-template-columns: 1fr 1fr;
  }
}

.step-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.3rem;
  display: flex;
  gap: 1rem;
}

.step-num {
  width: 32px;
  height: 32px;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid var(--border-accent);
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.4rem;
}

.step-content p {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.45;
}

.code-box {
  background: #080b12;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  overflow-x: auto;
}

.code-box pre {
  margin: 0;
}

.code-box code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.4;
}

.alert-inline {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: #fde68a;
  margin-top: 0.6rem;
}

/* ==============================================================
   MODAL QR
   ============================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  max-width: 480px;
  width: 100%;
  padding: 2rem;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  position: relative;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-backdrop.open .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.modal-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s ease;
}

.btn-close:hover {
  color: #fff;
}

.modal-instructions {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.5rem;
}

.qr-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
}

.qrcode-wrapper {
  background: #ffffff;
  padding: 16px;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 260px;
  height: 260px;
}

.qrcode-wrapper img, .qrcode-wrapper canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.qr-url-box {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.qr-url-box input {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: center;
}

/* Modo Fullscreen para proyector */
body.fullscreen-qr .modal-card {
  max-width: 600px;
}

body.fullscreen-qr .qrcode-wrapper {
  width: 340px;
  height: 340px;
}

/* ==============================================================
   FOOTER
   ============================================================== */
.footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.footer p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}
