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

:root {
  /* Paleta Corporativa TheTrulyFood (Tema Claro) */
  --brand-green: #2D5A27;
  --brand-green-hover: #21431d;
  --brand-green-light: #44803d;
  --brand-green-tint: rgba(45, 90, 39, 0.08);
  --brand-green-glow: rgba(45, 90, 39, 0.2);
  
  --bg-light: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  
  --border-color: #e2e8f0;
  --border-color-highlight: rgba(45, 90, 39, 0.3);
  
  --text-dark: #0f172a;
  --text-charcoal: #1e293b;
  --text-muted: #64748b;
  
  --status-active-bg: rgba(45, 90, 39, 0.1);
  --status-active-border: rgba(45, 90, 39, 0.35);
  --status-active-text: #2D5A27;
  
  --status-warning-bg: #fffbeb;
  --status-warning-border: #fde68a;
  --status-warning-text: #b45309;

  --status-danger-bg: #fef2f2;
  --status-danger-border: #fecaca;
  --status-danger-text: #dc2626;

  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  
  --shadow-main: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: var(--bg-light);
  background-image: 
    radial-gradient(at 0% 0%, rgba(45, 90, 39, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(226, 232, 240, 0.6) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-dark);
  min-height: 100vh;
  padding: 2.5rem 1rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.portal-container {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
}

/* Header Corporativo Claro */
.portal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.brand-header-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo-accent {
  width: 12px;
  height: 28px;
  background-color: var(--brand-green);
  border-radius: 4px;
  display: inline-block;
}

.portal-title-group p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.4rem;
  line-height: 1.5;
}

/* Luz de Estado de Conexión (Verde / Roja) */
.badge-status-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.status-light-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.status-light-dot.active {
  background-color: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.75);
}

.status-light-dot.error {
  background-color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.75);
}

/* Grilla de Tarjetas */
.portal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .portal-grid {
    grid-template-columns: 1fr;
  }
}

/* Tarjetas */
.portal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.85rem;
  box-shadow: var(--shadow-main);
  transition: var(--transition-fast);
}

.portal-card:hover {
  border-color: var(--border-color-highlight);
  box-shadow: 0 15px 30px -10px rgba(45, 90, 39, 0.08);
}

.portal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.portal-card-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.icon-svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--brand-green);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Lista de Productos Incluidos */
.product-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.product-item {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-charcoal);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.product-item::before {
  content: '•';
  color: var(--brand-green);
  font-weight: 800;
  font-size: 1.2rem;
}

/* Badge de Tarjeta (Visa, Mastercard, etc) */
.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--brand-green-tint);
  border: 1px solid var(--border-color-highlight);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  color: var(--brand-green);
  font-size: 0.9rem;
}

/* Badges de Estado */
.status-badge {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.status-badge.active {
  background: var(--status-active-bg);
  color: var(--status-active-text);
  border: 1px solid var(--status-active-border);
}

.status-badge.paused {
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
  border: 1px solid var(--status-warning-border);
}

/* Detalles */
.subscription-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.detail-label {
  color: var(--text-muted);
  font-weight: 500;
}

.detail-value {
  font-weight: 600;
  color: var(--text-charcoal);
}

.detail-value.highlight-monday {
  color: #ffffff;
  background: var(--brand-green);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

/* Acciones y Botones */
.portal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.btn {
  width: 100%;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn .btn-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.btn-primary {
  background-color: var(--brand-green);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--brand-green-glow);
}

.btn-primary:hover {
  background-color: var(--brand-green-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(45, 90, 39, 0.3);
}

.btn-warning {
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
  border: 1px solid var(--status-warning-border);
}

.btn-warning:hover {
  background: #fef3c7;
  transform: translateY(-2px);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-charcoal);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-light);
  border-color: var(--brand-green);
  color: var(--brand-green);
  transform: translateY(-2px);
}

.btn-disabled, .btn:disabled {
  background: var(--bg-light) !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border-color) !important;
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Tabla de Historial tema claro */
.history-section {
  width: 100%;
}

.table-responsive {
  overflow-x: auto;
  margin-top: 1rem;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.history-table th {
  padding: 0.9rem 1rem;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 2px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  background: var(--bg-light);
}

.history-table td {
  padding: 1.05rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-charcoal);
}

.history-table tr:hover td {
  background: rgba(45, 90, 39, 0.02);
}

.payment-status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
}

.payment-status-badge.success {
  background: var(--status-active-bg);
  color: var(--status-active-text);
  border: 1px solid var(--status-active-border);
}

.payment-status-badge.failed {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
  border: 1px solid var(--status-danger-border);
}

/* Modales Tema Claro */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
}

.modal-body {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 1rem 0 1.5rem 0;
  line-height: 1.6;
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
}

/* Toasts Tema Claro */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1000;
}

.toast {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-main);
  color: var(--text-dark);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.success { border-left: 4px solid var(--brand-green); }
.toast.error { border-left: 4px solid var(--status-danger-text); }
.toast.info { border-left: 4px solid var(--text-muted); }

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