/**
 * Nombre: components.css
 * Propósito: Estilos de componentes reutilizables.
 * Dependencias: tokens.css, core.css.
 * Responsabilidad: Botones, cards, modales, formularios, toasts.
 * Autor: PREVENGO SAS
 * Fecha: 2026-08-02
 */

/* Buttons */
.prv-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--prv-space-sm);
  padding: var(--prv-space-md) var(--prv-space-xl);
  border-radius: var(--prv-border-radius);
  font-size: var(--prv-text-sm);
  font-weight: 600;
  transition: all var(--prv-transition);
  white-space: nowrap;
}

.prv-button--primary {
  background: var(--prv-color-primary);
  color: var(--prv-color-white);
  box-shadow: var(--prv-shadow);
}

.prv-button--primary:hover,
.prv-button--primary:focus-visible {
  background: var(--prv-color-secondary);
  transform: translateY(-2px);
  box-shadow: var(--prv-shadow-lg);
}

.prv-button--secondary {
  background: var(--prv-color-secondary);
  color: var(--prv-color-white);
  box-shadow: var(--prv-shadow);
}

.prv-button--secondary:hover,
.prv-button--secondary:focus-visible {
  background: var(--prv-color-accent);
  color: var(--prv-color-dark);
  transform: translateY(-2px);
  box-shadow: var(--prv-shadow-lg);
}

.prv-button--outline {
  background: transparent;
  color: var(--prv-color-primary);
  border: 2px solid var(--prv-color-primary);
}

.prv-button--outline:hover,
.prv-button--outline:focus-visible {
  background: var(--prv-color-primary);
  color: var(--prv-color-white);
}

.prv-button--ghost {
  background: rgba(255, 255, 255, 0.15);
  color: var(--prv-color-white);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.prv-button--ghost:hover,
.prv-button--ghost:focus-visible {
  background: rgba(255, 255, 255, 0.25);
}

.prv-button--sm {
  padding: var(--prv-space-sm) var(--prv-space-lg);
  font-size: var(--prv-text-xs);
}

.prv-button--lg {
  padding: var(--prv-space-lg) var(--prv-space-2xl);
  font-size: var(--prv-text-base);
}

.prv-button--full {
  width: 100%;
}

.prv-button.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.prv-button .icon {
  width: 16px;
  height: 16px;
}

/* Cards */
.prv-card {
  background: linear-gradient(180deg, #FFFFFF 0%, #F4F9FF 100%);
  border-radius: var(--prv-border-radius-lg);
  padding: var(--prv-space-xl);
  box-shadow: 0 6px 18px rgba(11, 79, 163, 0.18);
  border: 1.5px solid #C9DDF4;
  transition: transform var(--prv-transition), box-shadow var(--prv-transition), border-color var(--prv-transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.prv-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(11, 79, 163, 0.28);
  border-color: var(--prv-color-secondary);
}

.prv-card__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--prv-border-radius);
  background: rgba(19, 139, 199, 0.1);
  color: var(--prv-color-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--prv-space-lg);
}

.prv-card__icon .icon {
  width: 28px;
  height: 28px;
}

.prv-card__media {
  position: relative;
  height: 150px;
  margin: calc(var(--prv-space-xl) * -1) calc(var(--prv-space-xl) * -1) var(--prv-space-lg);
  border-radius: var(--prv-border-radius-lg) var(--prv-border-radius-lg) 0 0;
  overflow: hidden;
}

.prv-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.prv-card__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 31, 73, 0) 40%, rgba(2, 31, 73, 0.45) 100%);
}

.prv-card__title {
  font-size: var(--prv-text-lg);
  font-weight: 600;
  color: var(--prv-color-dark);
  margin-bottom: var(--prv-space-sm);
}

.prv-card__desc {
  font-size: var(--prv-text-sm);
  color: var(--prv-color-text);
  opacity: 0.85;
  line-height: 1.6;
}

/* Service card */
.prv-service-card {
  background: linear-gradient(180deg, #FFFFFF 0%, #F4F9FF 100%);
  border-radius: var(--prv-border-radius-lg);
  box-shadow: 0 6px 18px rgba(11, 79, 163, 0.18);
  transition: transform var(--prv-transition), box-shadow var(--prv-transition), border-color var(--prv-transition);
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1.5px solid #C9DDF4;
}

.prv-service-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(11, 79, 163, 0.28);
  border-color: var(--prv-color-secondary);
}

.prv-service-card__header {
  display: flex;
  align-items: center;
  gap: var(--prv-space-md);
  padding: var(--prv-space-xl);
  background: linear-gradient(135deg, var(--prv-color-primary) 0%, var(--prv-color-secondary) 100%);
  color: var(--prv-color-white);
}

.prv-service-card__icon {
  width: 52px;
  height: 52px;
  border-radius: var(--prv-border-radius);
  background: rgba(255, 255, 255, 0.18);
  color: var(--prv-color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.prv-service-card__icon .icon {
  width: 26px;
  height: 26px;
}

.prv-service-card__title {
  font-size: var(--prv-text-lg);
  font-weight: 600;
  color: var(--prv-color-white);
  line-height: 1.3;
}

.prv-service-card__list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--prv-space-sm);
  padding: var(--prv-space-xl);
  margin-bottom: 0;
}

.prv-service-card__list li {
  font-size: var(--prv-text-sm);
  color: var(--prv-color-text);
  padding-left: var(--prv-space-md);
  position: relative;
}

.prv-service-card__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--prv-color-accent);
}

.prv-service-card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--prv-space-xs);
  font-size: var(--prv-text-sm);
  font-weight: 600;
  color: var(--prv-color-secondary);
  transition: gap var(--prv-transition);
  padding: 0 var(--prv-space-xl) var(--prv-space-xl);
}

.prv-service-card__link:hover,
.prv-service-card__link:focus-visible {
  gap: var(--prv-space-md);
}

.prv-service-card__link .icon {
  width: 16px;
  height: 16px;
}

/* Blog card */
.prv-blog-card {
  background: linear-gradient(180deg, #FFFFFF 0%, #F4F9FF 100%);
  border-radius: var(--prv-border-radius-lg);
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(11, 79, 163, 0.18);
  border: 1.5px solid #C9DDF4;
  transition: transform var(--prv-transition), box-shadow var(--prv-transition), border-color var(--prv-transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.prv-blog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(11, 79, 163, 0.28);
  border-color: var(--prv-color-secondary);
}

.prv-blog-card__image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--prv-color-background);
}

.prv-blog-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--prv-transition);
}

.prv-blog-card:hover .prv-blog-card__image img {
  transform: scale(1.05);
}

.prv-blog-card__badge {
  position: absolute;
  top: var(--prv-space-md);
  left: var(--prv-space-md);
}

.prv-blog-card__body {
  padding: var(--prv-space-xl);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.prv-blog-card__title {
  font-size: var(--prv-text-lg);
  font-weight: 600;
  color: var(--prv-color-dark);
  line-height: 1.4;
  margin-bottom: var(--prv-space-md);
  flex: 1;
}

.prv-blog-card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--prv-space-xs);
  font-size: var(--prv-text-sm);
  font-weight: 600;
  color: var(--prv-color-secondary);
}

.prv-blog-card__link .icon {
  width: 16px;
  height: 16px;
}

/* Badge */
.prv-badge {
  display: inline-flex;
  padding: var(--prv-space-xs) var(--prv-space-md);
  border-radius: 100px;
  font-size: var(--prv-text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.prv-badge--primary {
  background: var(--prv-color-primary);
  color: var(--prv-color-white);
}

.prv-badge--secondary {
  background: var(--prv-color-secondary);
  color: var(--prv-color-white);
}

.prv-badge--accent {
  background: var(--prv-color-accent);
  color: var(--prv-color-dark);
}

/* Modal */
.prv-modal {
  padding: 0;
  border: none;
  border-radius: var(--prv-border-radius-lg);
  box-shadow: var(--prv-shadow-lg);
  max-width: 560px;
  width: calc(100% - var(--prv-space-xl));
  background: var(--prv-color-white);
}

.prv-modal::backdrop {
  background: rgba(26, 37, 51, 0.6);
  backdrop-filter: blur(4px);
}

.prv-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--prv-space-xl);
  border-bottom: 1px solid var(--prv-color-background);
}

.prv-modal__title {
  font-size: var(--prv-text-xl);
  font-weight: 600;
  color: var(--prv-color-dark);
}

.prv-modal__close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--prv-color-text);
  transition: background var(--prv-transition);
}

.prv-modal__close:hover,
.prv-modal__close:focus-visible {
  background: var(--prv-color-background);
}

.prv-modal__body {
  padding: var(--prv-space-xl);
}

/* Form */
.prv-form-group {
  margin-bottom: var(--prv-space-lg);
}

.prv-form-label {
  display: block;
  font-size: var(--prv-text-sm);
  font-weight: 500;
  color: var(--prv-color-dark);
  margin-bottom: var(--prv-space-sm);
}

.prv-form-input,
.prv-form-textarea,
.prv-form-select {
  width: 100%;
  padding: var(--prv-space-md);
  border: 1px solid rgba(11, 79, 163, 0.2);
  border-radius: var(--prv-border-radius);
  font-size: var(--prv-text-base);
  color: var(--prv-color-text);
  background: var(--prv-color-white);
  transition: border-color var(--prv-transition), box-shadow var(--prv-transition);
}

.prv-form-input:focus,
.prv-form-textarea:focus,
.prv-form-select:focus {
  border-color: var(--prv-color-secondary);
  box-shadow: 0 0 0 3px rgba(19, 139, 199, 0.15);
  outline: none;
}

.prv-form-input.is-invalid,
.prv-form-textarea.is-invalid,
.prv-form-select.is-invalid {
  border-color: var(--prv-color-error);
}

.prv-form-error {
  font-size: var(--prv-text-xs);
  color: var(--prv-color-error);
  margin-top: var(--prv-space-xs);
}

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

.prv-form-actions {
  display: flex;
  gap: var(--prv-space-md);
  justify-content: flex-end;
  margin-top: var(--prv-space-xl);
}

/* Maintenance */
.maintenance {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(19, 139, 199, 0.18), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(73, 199, 232, 0.14), transparent 60%),
    linear-gradient(180deg, #F4F7FA 0%, #EAF2FA 100%);
  padding: var(--prv-space-2xl);
}

.maintenance__inner {
  max-width: 480px;
  width: 100%;
  text-align: center;
  background: var(--prv-color-white);
  border-radius: var(--prv-border-radius-lg);
  padding: var(--prv-space-3xl) var(--prv-space-2xl);
  box-shadow: var(--prv-shadow-lg);
  border: 1px solid rgba(11, 79, 163, 0.08);
}

.maintenance__logo {
  height: 72px;
  width: auto;
  border-radius: 14px;
  margin-bottom: var(--prv-space-xl);
  box-shadow: 0 10px 30px rgba(2, 31, 73, 0.18);
}

.maintenance__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--prv-space-lg);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 79, 163, 0.1);
  color: var(--prv-color-primary);
  animation: maintenancePulse 2s ease-in-out infinite;
}

@keyframes maintenancePulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

.maintenance__title {
  font-size: var(--prv-text-3xl);
  font-weight: 700;
  color: var(--prv-color-dark);
  margin-bottom: var(--prv-space-md);
  letter-spacing: -0.02em;
}

.maintenance__text {
  font-size: var(--prv-text-base);
  color: var(--prv-color-text);
  opacity: 0.85;
  line-height: 1.6;
  margin-bottom: var(--prv-space-2xl);
}

.maintenance__contact {
  display: flex;
  flex-direction: column;
  gap: var(--prv-space-sm);
  margin-bottom: var(--prv-space-2xl);
}

.maintenance__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--prv-space-sm);
  padding: var(--prv-space-md) var(--prv-space-lg);
  border-radius: var(--prv-border-radius);
  background: var(--prv-color-background);
  color: var(--prv-color-primary);
  font-size: var(--prv-text-sm);
  font-weight: 600;
  transition: background var(--prv-transition), transform var(--prv-transition);
}

.maintenance__link:hover,
.maintenance__link:focus-visible {
  background: rgba(11, 79, 163, 0.1);
  transform: translateY(-1px);
}

.maintenance__link--whatsapp {
  background: rgba(16, 185, 129, 0.12);
  color: #0f9d6e;
}

.maintenance__brand {
  font-size: var(--prv-text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--prv-color-text);
  opacity: 0.55;
}

/* Toast */
.prv-toast-stack {
  position: fixed;
  z-index: 1003;
  display: flex;
  flex-direction: column;
  gap: var(--prv-space-md);
  max-width: 360px;
  width: 100%;
}

.prv-toast-stack--bottom-right {
  bottom: var(--prv-space-xl);
  right: var(--prv-space-xl);
}

.prv-toast {
  background: var(--prv-color-white);
  border-radius: var(--prv-border-radius);
  box-shadow: var(--prv-shadow-lg);
  padding: var(--prv-space-lg);
  border-left: 4px solid var(--prv-color-primary);
  animation: prvToastIn 0.3s ease-out;
}

.prv-toast--success {
  border-left-color: var(--prv-color-success);
}

.prv-toast--error {
  border-left-color: var(--prv-color-error);
}

.prv-toast--warning {
  border-left-color: var(--prv-color-warning);
}

.prv-toast__title {
  font-weight: 600;
  color: var(--prv-color-dark);
  margin-bottom: var(--prv-space-xs);
}

.prv-toast__message {
  font-size: var(--prv-text-sm);
  color: var(--prv-color-text);
}

@keyframes prvToastIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
