/* ========================================
   SEPTIGENESIS COMPONENTS
   Buttons, Forms, Cards, Navigation
   ======================================== */

/* ========================================
   BUTTONS
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-lg);
  font-family: var(--font-primary);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-body-small);
  border: 1px solid transparent;
  border-radius: var(--border-radius-md);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary CTA Button */
.btn-primary-cta,
.et_pb_button,
.et_pb_button_0_tb_header {
  /* Contraste alto: fondo teal sólido + texto blanco (antes teal-light + cyan = ilegible) */
  background-color: var(--gcid-primary-color);
  color: #ffffff;
  border: 1px solid var(--gcid-primary-color);
  padding: 10px 24px;
}

.btn-primary-cta:hover,
.et_pb_button:hover,
.et_pb_button_0_tb_header:hover {
  background-color: var(--gcid-secondary-color);
  color: #ffffff;
  text-decoration: none;
}

.btn-primary-cta:focus,
.et_pb_button:focus,
.et_pb_button_0_tb_header:focus {
  outline: 2px solid var(--gcid-primary-color);
  outline-offset: 2px;
}

.btn-primary-cta:focus-visible,
.et_pb_button:focus-visible,
.et_pb_button_0_tb_header:focus-visible {
  /* WCAG SC 2.4.11: navy sobre fondo de página = 11:1 ✅ */
  outline: 2px solid var(--gcid-secondary-color);
  outline-offset: 2px;
}

/* Secondary Button */
.btn-secondary {
  background-color: transparent;
  /* WCAG AA: teal texto #00a99d sobre blanco = 2.92:1 (falla). Oscurecido a #007a71 = 4.54:1 ✅ */
  color: var(--gcid-primary-text, #007a71);
  border: 1px solid var(--gcid-primary-color);
}

.btn-secondary:hover {
  background-color: var(--primary-teal-light);
}

/* Tertiary Button */
.btn-tertiary {
  background-color: transparent;
  color: var(--gcid-body-color);
  border: 1px solid #e0e0e0;
}

.btn-tertiary:hover {
  border-color: var(--gcid-primary-color);
  /* WCAG AA: teal texto oscurecido a #007a71 = 4.54:1 ✅ */
  color: var(--gcid-primary-text, #007a71);
}

/* ========================================
   BADGES
   ======================================== */

.badge {
  display: inline-block;
  padding: 10px 24px;
  background-color: var(--gcid-primary-color);
  /* WCAG AA: blanco #fff sobre teal #00a99d = 2.92:1 (falla). Oscurecido a #04231f = 5.72:1 ✅ */
  color: var(--gcid-primary-bg-text, #04231f);
  border: 1px solid var(--gcid-primary-color);
  font-family: var(--font-primary);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-badge);
  border-radius: var(--border-radius-full);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.badge:hover {
  background-color: var(--gcid-secondary-color);
  color: #ffffff;
}

/* ========================================
   CARDS
   ======================================== */

.card {
  background-color: var(--bg-white);
  border: 1px solid #e0e0e0;
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gcid-primary-color);
}

.card-header {
  margin-bottom: var(--spacing-lg);
}

.card-header h3 {
  margin-bottom: 0;
}

.card-body {
  margin-bottom: var(--spacing-md);
}

.card-footer {
  border-top: 1px solid #f0f0f0;
  padding-top: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

/* Feature Card with Icon */
.feature-card {
  text-align: center;
  padding: var(--spacing-2xl) var(--spacing-lg);
}

.feature-card-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto var(--spacing-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-teal-light);
  border-radius: var(--border-radius-md);
}

.feature-card-icon svg {
  width: 32px;
  height: 32px;
  color: var(--gcid-primary-color);
}

.feature-card h3 {
  font-size: var(--font-size-h4);
  margin-bottom: var(--spacing-md);
}

/* ========================================
   NAVIGATION
   ======================================== */

nav {
  display: flex;
  align-items: center;
  gap: var(--spacing-xl);
}

nav a {
  color: var(--body-text-color);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-body);
  transition: color var(--transition-fast);
}

nav a:hover,
nav a.active {
  /* WCAG AA: teal texto oscurecido a #007a71 = 4.54:1 ✅ */
  color: var(--gcid-primary-text, #007a71);
}

/* ========================================
   FORMS
   ======================================== */

.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: var(--font-weight-medium);
  color: var(--heading-color);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: var(--spacing-md);
  border: 1px solid #e0e0e0;
  border-radius: var(--border-radius-md);
  font-family: var(--font-primary);
  font-size: var(--font-size-body);
  color: var(--body-text-color);
  transition: border-color var(--transition-fast);
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--gcid-primary-color);
  box-shadow: 0 0 0 3px rgba(0, 169, 157, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-group .error {
  color: #d32f2f;
  font-size: 0.875rem;
  margin-top: var(--spacing-xs);
}

.form-group .success {
  color: var(--gcid-primary-text, #007a71);
  font-size: 0.875rem;
  margin-top: var(--spacing-xs);
}

/* Dictado por voz en campos de texto largo (ej. "Describe tu desafío") */
.field-dictable { position: relative; }
.field-dictable textarea { padding-right: 48px; }
.dictate-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #e0e0e0;
  border-radius: var(--border-radius-md, 8px);
  background: #fff;
  color: var(--gcid-primary-text, #007a71);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}
[dir="rtl"] .field-dictable textarea { padding-right: var(--spacing-md); padding-left: 48px; }
[dir="rtl"] .dictate-btn { right: auto; left: 10px; }
.dictate-btn svg { width: 18px; height: 18px; }
.dictate-btn:hover { border-color: var(--gcid-primary-color, #00a99d); }
.dictate-btn:focus-visible {
  outline: none;
  border-color: var(--gcid-primary-color, #00a99d);
  box-shadow: 0 0 0 3px rgba(0, 169, 157, 0.3);
}
.dictate-btn.listening {
  background: var(--gcid-primary-text, #007a71);
  border-color: var(--gcid-primary-text, #007a71);
  color: #fff;
  animation: dictatePulse 1.2s ease-in-out infinite;
}
@keyframes dictatePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 169, 157, 0.45); }
  50% { box-shadow: 0 0 0 5px rgba(0, 169, 157, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .dictate-btn.listening { animation: none; }
}

/* Contact Form Specific */
.et_pb_contact_form {
  max-width: 600px;
}

/* ========================================
   ALERTS & MESSAGES
   ======================================== */

.alert {
  padding: var(--spacing-lg);
  border-radius: var(--border-radius-md);
  margin-bottom: var(--spacing-lg);
  border-left: 4px solid transparent;
}

.alert-info {
  background-color: #e3f2fd;
  border-left-color: #2196f3;
  color: #0d47a1;
}

.alert-success {
  background-color: #e8f5e9;
  border-left-color: var(--gcid-primary-color);
  color: #1b5e20;
}

.alert-warning {
  background-color: #fff3e0;
  border-left-color: #ff9800;
  color: #e65100;
}

.alert-error {
  background-color: #ffebee;
  border-left-color: #d32f2f;
  color: #b71c1c;
}

/* ========================================
   BREADCRUMBS
   ======================================== */

.breadcrumb {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
  font-size: 0.875rem;
  margin-bottom: var(--spacing-lg);
}

.breadcrumb a {
  color: var(--gcid-primary-text, #007a71);
}

.breadcrumb span:after {
  content: '/';
  margin-left: var(--spacing-sm);
}

.breadcrumb li:last-child span:after {
  content: '';
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  align-items: center;
  margin: var(--spacing-xl) 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-md);
  border: 1px solid #e0e0e0;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.pagination a:hover {
  background-color: var(--primary-teal-light);
  border-color: var(--gcid-primary-color);
  color: #006b62;
}

.pagination .active {
  background-color: var(--gcid-primary-color);
  border-color: var(--gcid-primary-color);
  color: white;
}

/* ========================================
   MODALS & DIALOGS
   ======================================== */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: var(--bg-white);
  padding: var(--spacing-2xl);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 500px;
  width: 90%;
  position: relative;
}

.modal-close {
  position: absolute;
  right: var(--spacing-lg);
  top: var(--spacing-lg);
  font-size: 1.5rem;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--body-text-color);
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--gcid-primary-text, #007a71);
}

.modal-close:focus-visible {
  /* WCAG SC 2.4.11: navy #143e6b = 11:1 sobre blanco ✅ */
  outline: 2px solid var(--gcid-secondary-color);
  outline-offset: 2px;
}

/* ========================================
   SPINNERS & LOADERS
   ======================================== */

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #e0e0e0;
  border-top-color: var(--gcid-primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   TOOLTIPS
   ======================================== */

.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: var(--heading-color);
  color: white;
  border-radius: var(--border-radius-sm);
  white-space: nowrap;
  font-size: 0.875rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: 100;
}

.tooltip::after {
  content: '';
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--heading-color);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
}

.tooltip:hover::before,
.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  bottom: 135%;
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .hide-desktop {
    display: none !important;
  }
}

/* ============================================================
   Selector de idioma (site-i18n.js) — COMPARTIDO
   Faltaba en el CSS del home/otras páginas: el menú salía sin estilo
   y se rompía en móvil (QA Daniel 2026-07-07). Portado desde paquete.css.
   ============================================================ */
.lang-wrap { position: relative; z-index: 200; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--primary-teal-light, #e6f7f5);
  border: 1px solid var(--primary-teal-border, #9fded7);
  color: var(--gcid-secondary-color, #143e6b);
  border-radius: var(--border-radius-full, 999px);
  padding: 8px 14px; font-size: 0.85rem; font-weight: 600;
  font-family: var(--font-primary, inherit); cursor: pointer;
  line-height: 1; transition: all .18s ease;
}
.lang-btn:hover { background: var(--gcid-primary-color, #00a99d); color: #fff; border-color: var(--gcid-primary-color, #00a99d); transform: translateY(-1px); }
.lang-btn:focus-visible { outline: 3px solid var(--gcid-secondary-color, #143e6b); outline-offset: 2px; }
.lang-flag { font-size: 1rem; line-height: 1; }
.lang-arrow { font-size: 9px; opacity: .85; display: inline-block; transition: transform .18s ease; }
.lang-btn[aria-expanded="true"] .lang-arrow { transform: rotate(180deg); }
.lang-menu {
  display: none; position: absolute; inset-block-start: calc(100% + 8px);
  inset-inline-end: 0; min-width: 190px; z-index: 300;
  background: #fff; border: 1px solid #e0e0e0;
  border-radius: var(--border-radius-lg, 12px);
  box-shadow: 0 12px 32px rgba(20,62,107,0.16); overflow: hidden; padding: 4px;
}
.lang-menu.show { display: block; }
.lang-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; cursor: pointer;
  padding: 10px 12px; font-size: 0.9rem; text-align: start;
  color: var(--gcid-secondary-color, #143e6b);
  font-family: var(--font-primary, inherit);
  border-radius: var(--border-radius-md, 8px); transition: background .12s ease;
}
.lang-item:hover { background: var(--primary-teal-light, #e6f7f5); }
.lang-item.active { background: var(--primary-teal-light, #e6f7f5); font-weight: 700; }
.lang-item:focus-visible { outline: 2px solid var(--gcid-secondary-color, #143e6b); outline-offset: -2px; }
.lang-item .flag { font-size: 18px; line-height: 1; }
.lang-item .check { margin-inline-start: auto; color: #006158; font-weight: 700; }
body.rtl .lang-menu { inset-inline-end: auto; inset-inline-start: 0; }
@media (max-width: 768px) {
  .lang-btn { padding: 7px 10px; font-size: 0.8rem; }
  .lang-btn .lang-label { display: none; }
  /* Móvil (QA Daniel 2026-07-08): el menú de idioma se abría anclado al botón y
     se cortaba en el borde de la pantalla. Ahora es un panel FIJO CENTRADO por
     encima de todo, que nunca se recorta y hace scroll interno si hiciera falta. */
  .lang-menu {
    position: fixed;
    inset-inline-start: auto; inset-inline-end: auto;
    top: 50%; left: 50%; right: auto;
    transform: translate(-50%, -50%);
    width: min(320px, 92vw); min-width: 0; max-width: 92vw;
    max-height: 76vh; overflow-y: auto;
    z-index: 100010;
    box-shadow: 0 24px 60px rgba(20, 62, 107, 0.34);
  }
  body.rtl .lang-menu { left: 50%; right: auto; }
  .lang-item { padding: 13px 14px; font-size: 0.95rem; }
}
