/* ============================================================
   SL VENTAS — Estilos globales
   ============================================================ */

:root {
  --bg-color: #0b1220;
  --accent: #38bdf8;
  --accent-dark: #0284c7;
  --panel-bg: linear-gradient(135deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.5) 100%);
  --border-soft: rgba(255, 255, 255, 0.12);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --danger: #f87171;
  --ok: #4ade80;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: var(--bg-color);
  background-image:
    radial-gradient(circle at 15% 10%, rgba(56, 189, 248, 0.08), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(2, 132, 199, 0.10), transparent 45%);
  background-attachment: fixed;
  color: #0f2133;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 40px;
}

/* --- CONTENEDOR PRINCIPAL (DASHBOARD) --- */
.software-platform {
  background: var(--panel-bg);
  border: 1px solid var(--border-soft);
  border-radius: 32px;
  padding: 60px;
  width: 100%;
  max-width: 1240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 50px 85px -20px rgba(0, 0, 0, 0.8), inset 0 0 30px rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

.top-bar {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}
.top-bar .user-email {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}
.link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}
.link-btn:hover { color: var(--accent); }

.header-area {
  text-align: center;
  margin-bottom: 40px;
}
.badge {
  display: inline-flex;
  align-items: center;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent);
  padding: 8px 20px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 20px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  text-transform: uppercase;
  letter-spacing: 1px;
}
h1 {
  color: #ffffff;
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
}

/* --- SOLAPAS --- */
.tabs-nav {
  display: flex;
  gap: 15px;
  width: 100%;
  margin-bottom: 45px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 20px;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.tab-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 14px 32px;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tab-btn:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}
.tab-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25) 0%, rgba(2, 132, 199, 0.25) 100%);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.2);
}
.tab-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.02);
}

.tab-panel { display: none; width: 100%; }
.tab-panel.active { display: flex; flex-direction: column; }

.split-layout {
  display: flex;
  width: 100%;
  gap: 50px;
  align-items: center;
  text-align: left;
}
.split-info { flex: 1; }
.split-action {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

p.description {
  color: #cbd5e1;
  font-size: 1.2rem;
  line-height: 1.7;
}
.button-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Botón Mercado Pago */
.btn-redirect {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #009ee3;
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.5px;
  padding: 22px 36px;
  border-radius: 50px;
  box-shadow: 0 15px 30px rgba(0, 158, 227, 0.3);
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
}
.btn-redirect svg { width: 28px; height: 28px; fill: #ffffff; }
.btn-redirect:hover:not(:disabled) {
  background: #00b1ff;
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(0, 158, 227, 0.5);
}
.btn-redirect:disabled { opacity: 0.6; cursor: wait; }

.unlock-hint {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-top: 16px;
  text-align: center;
}

/* Botones genéricos */
.btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 30px;
  border-radius: 18px;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: #ffffff;
  box-shadow: 0 6px 24px rgba(2, 132, 199, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(2, 132, 199, 0.5); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }
.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-2px); }
.btn-danger { background: rgba(248, 113, 113, 0.12); color: var(--danger); border: 1px solid rgba(248, 113, 113, 0.3); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.2); }

/* --- MANUAL --- */
.panel-header { margin-bottom: 30px; }
.panel-title { font-size: 1.8rem; font-weight: 800; color: #ffffff; margin-bottom: 6px; }
.panel-subtitle { font-size: 1rem; color: var(--text-muted); }
.alert-box {
  background: rgba(56, 189, 248, 0.06);
  border-left: 4px solid var(--accent);
  padding: 20px;
  border-radius: 16px;
  font-size: 1rem;
  line-height: 1.6;
  color: #e2e8f0;
  margin-bottom: 35px;
  width: 100%;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  width: 100%;
}
.step-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 30px;
  transition: border-color 0.3s;
}
.step-card:hover { border-color: rgba(56, 189, 248, 0.3); }
.step-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 10px;
}
.step-text { color: #cbd5e1; font-size: 0.98rem; line-height: 1.6; }
.code-span {
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: monospace;
  color: var(--accent);
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Footer */
.footer-info {
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 30px;
  margin-top: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 16px;
}
.contact-mail { color: var(--text-muted); text-decoration: none; font-weight: 600; transition: color 0.2s; }
.contact-mail:hover { color: var(--accent); }
.specs { color: var(--text-muted); font-weight: 600; }

/* --- LOGIN / REGISTRO --- */
.auth-card {
  background: var(--panel-bg);
  border: 1px solid var(--border-soft);
  border-radius: 32px;
  padding: 56px 48px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 50px 85px -20px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(25px);
}
.auth-title { font-size: 2rem; }
.auth-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.field-label { color: var(--text-muted); font-size: 0.85rem; font-weight: 700; margin-top: 14px; }
.field-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 16px;
  color: #ffffff;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}
.field-input:focus { border-color: var(--accent); }
.auth-form .btn { margin-top: 22px; }
.auth-switch { text-align: center; margin-top: 24px; color: var(--text-muted); font-size: 0.9rem; }
.auth-switch a { color: var(--accent); font-weight: 700; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.form-msg { font-size: 0.88rem; min-height: 18px; margin-top: 10px; }
.form-msg-error { color: var(--danger); }
.form-msg-ok { color: var(--ok); }

/* --- ADMIN --- */
.admin-table-wrap { width: 100%; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.92rem;
  color: #e2e8f0;
}
.admin-table th { color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; }
.status-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}
.status-yes { background: rgba(74, 222, 128, 0.12); color: var(--ok); }
.status-no { background: rgba(148, 163, 184, 0.12); color: var(--text-muted); }
.status-admin { background: rgba(56, 189, 248, 0.15); color: var(--accent); }
.admin-actions { display: flex; gap: 8px; }
.admin-actions button {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-grant { background: rgba(74, 222, 128, 0.12); color: var(--ok); border-color: rgba(74, 222, 128, 0.3); }
.btn-grant:hover { background: rgba(74, 222, 128, 0.2); }
.btn-revoke { background: rgba(248, 113, 113, 0.12); color: var(--danger); border-color: rgba(248, 113, 113, 0.3); }
.btn-revoke:hover { background: rgba(248, 113, 113, 0.2); }

.loading-text { color: var(--text-muted); text-align: center; padding: 40px 0; width: 100%; }

/* --- Responsive --- */
@media (max-width: 992px) {
  .split-layout { flex-direction: column; gap: 30px; text-align: center; }
  .software-platform { padding: 40px 30px; }
  h1 { font-size: 2.8rem; }
}
@media (max-width: 768px) {
  body { padding: 20px 15px; }
  .tabs-nav { flex-direction: column; gap: 10px; }
  .tab-btn { width: 100%; justify-content: center; }
  .footer-info { flex-direction: column; text-align: center; }
  .auth-card { padding: 40px 26px; }
}
