/* ============================================================
   ProTool · Estilos globales
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #07090f;
  --bg-card:   #0d1017;
  --bg-input:  #0a0d14;
  --bg-hover:  #0f1521;
  --border:    #1a2235;
  --border-2:  #243047;
  --text:      #e2e8f0;
  --text-muted:#94a3b8;
  --text-dim:  #64748b;
  --text-dark: #334155;
  --cyan:      #22d3ee;
  --cyan-d:    #06b6d4;
  --purple:    #7c3aed;
  --green:     #10b981;
  --red:       #ef4444;
  --radius:    8px;
  --font:      'Inter', sans-serif;
  --mono:      'JetBrains Mono', monospace;
}

html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: var(--font); font-size: inherit; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Utilities ── */
.mono { font-family: var(--mono); }
.text-muted { color: var(--text-muted); }
.text-dim   { color: var(--text-dim); }
.text-cyan  { color: var(--cyan); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }

.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 1000; }
.modal-content { 
    margin: 10% auto; width: 350px; background: #0d171d; 
    border: 1px solid #2e3b44; padding: 30px; position: relative;
}
.input-field { 
    width: 100%; padding: 12px; margin: 10px 0; background: #070d10; 
    border: 1px solid #2e3b44; color: white; border-radius: 8px; box-sizing: border-box;
}
.close { position: absolute; top: 10px; right: 15px; cursor: pointer; color: white; font-size: 20px; }


/* Estilo específico para el botón dentro del formulario del modal */
.modal .dl-btn {
    display: flex;             /* Necesario para centrar el contenido */
    align-items: center;
    justify-content: center;   /* Centra el texto horizontalmente */
    width: 200px;              /* Ajusta este valor para el ancho deseado */
    margin: 15px auto 0 auto;  /* Centra el botón dentro del modal */
    padding: 12px 20px;        /* Mantiene el estilo del botón */
    border-radius: 10px;
    border: none;
    cursor: pointer;
}


/* El contenedor principal que debe desenfocarse */
#main-container { transition: filter 0.3s ease; }
.blur-active { filter: blur(5px); pointer-events: none; }

.modal { 
    display: none; position: fixed; inset: 0; 
    background: rgba(0,0,0,0.7); z-index: 9999;
    align-items: center; justify-content: center;
}
.modal-content { 
    background: #0d171d; border: 1px solid #2e3b44; 
    padding: 30px; border-radius: 12px; width: 350px; position: relative;
}
.close-btn { 
    position: absolute; 
    top: 10px; 
    right: 15px; 
    cursor: pointer; 
    color: #fff; 
    font-size: 1.5rem; 
}



/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid;
  font-size: .7rem;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: .04em;
  background: none;
  cursor: default;
}
.badge-active   { background: rgba(16,185,129,.1); color: var(--green); border-color: rgba(16,185,129,.3); cursor: pointer; }
.badge-inactive { background: rgba(100,116,139,.1); color: var(--text-dim); border-color: rgba(100,116,139,.2); cursor: pointer; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--radius);
  border: none;
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
  transition: opacity .15s, transform .15s;
  white-space: nowrap;
}
.btn:hover { opacity: .88; transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--cyan-d), var(--purple)); color: #fff; }
.btn-ghost   { background: transparent; border: 1px solid var(--border); color: var(--text-dim); }
.btn-ghost:hover { color: var(--text-muted); }
.btn-danger  { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.3); color: var(--red); }
.btn-sm      { padding: 6px 14px; font-size: .8rem; }
.btn-icon    {
  width: 30px; height: 30px; padding: 0;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-dark); border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .9rem; cursor: pointer; transition: all .15s;
}
.btn-icon:hover { transform: none; }
.btn-icon.edit:hover   { background: rgba(148,163,184,.1); color: var(--text-muted); border-color: rgba(148,163,184,.3); }
.btn-icon.credits:hover{ background: rgba(34,211,238,.1);  color: var(--cyan);       border-color: rgba(34,211,238,.3); }
.btn-icon.delete:hover { background: rgba(239,68,68,.1);   color: var(--red);        border-color: rgba(239,68,68,.3); }

/* ── Inputs ── */
.input, .select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 13px;
  color: var(--text);
  font-size: .88rem;
  outline: none;
  transition: border-color .15s;
}
.input:focus, .select:focus { border-color: var(--border-2); }
.input::placeholder { color: var(--text-dark); }
.select { cursor: pointer; }
.label {
  display: block;
  font-size: .68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-family: var(--mono);
  margin-bottom: 0.15rem; /* Reducido de 0.4rem a 0.15rem */
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}

/* ── Alerts ── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: .83rem;
  margin-bottom: 1.25rem;
  border: 1px solid;
}
.alert-error   { background: rgba(239,68,68,.1); color: var(--red);   border-color: rgba(239,68,68,.3); }
.alert-success { background: rgba(16,185,129,.1); color: var(--green); border-color: rgba(16,185,129,.3); }

/* ── Table ── */
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .85rem; background: var(--bg-card); }
thead tr { border-bottom: 1px solid var(--border); }
th {
  padding: 10px 14px;
  text-align: left;
  font-size: .65rem;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-family: var(--mono);
  font-weight: 500;
  white-space: nowrap;
}
td { padding: 11px 14px; border-bottom: 1px solid #131720; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-hover); }

/* ── Modal ── */
.modal-overlay {
    display: none; 
    position: fixed; 
    inset: 0; 
    z-index: 9999;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(4px);
    align-items: center; 
    justify-content: center; 
    padding: 1rem;
}
.modal-overlay.open { 
    display: flex !important; 
}
.modal { 
    display: block; /* Mantenemos block para que el flex del padre lo gestione */
    background: var(--bg-card); 
    border: 1px solid var(--border);
    border-radius: 14px; 
    padding: 1.75rem; 
    width: 100%; 
    max-width: 440px;
    position: relative;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.modal-header h2 { font-size: 1rem; font-weight: 600; }
.modal-footer { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.5rem; }
.modal-close {
  background: none; border: none; color: var(--text-dim);
  font-size: 1.1rem; cursor: pointer; padding: 4px; border-radius: 4px; line-height: 1;
}

/* Acercar los labels a los inputs */
#form-step-1 .label {
    margin-bottom: 2px !important;
}

/* Centrar y ajustar el botón */
#form-step-1 .dl-btn {
    display: flex !important;
    justify-content: center !important;
    width: 200px !important;      /* Cambia esto si quieres el botón más o menos ancho */
    margin: 15px auto 0 auto !important; /* Centra el botón horizontalmente */
    padding: 12px 20px !important;
}

/* ── Download page ── */
.dl-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7,9,15,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem;
}
.logo-mark {
  width: 68px;
  height: 68px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: none;
  border-radius: 0;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.hero {
  padding: 6rem 2rem 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  top: -80px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(6,182,212,.06) 0%, transparent 70%);
  pointer-events: none;
}
.version-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 100px; padding: 5px 15px;
  font-size: .72rem; color: var(--cyan);
  font-family: var(--mono); letter-spacing: .04em;
  margin-bottom: 2rem;
}
.version-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 6px var(--cyan);
  flex-shrink: 0;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.03em;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero h1 span {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p { font-size: 1.05rem; color: var(--text-dim); max-width: 460px; margin: 0 auto 2.5rem; line-height: 1.7; }
.dl-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--cyan-d), var(--purple));
  color: #fff; font-weight: 600; font-size: 1rem;
  padding: 14px 34px; border-radius: 10px;
  border: none; cursor: pointer;
  box-shadow: 0 0 30px rgba(6,182,212,.25);
  transition: opacity .15s, transform .15s;
}
.dl-btn:hover { opacity: .9; transform: translateY(-1px); }
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  max-width: 900px; margin: 0 auto;
  padding: 0 2rem 4rem;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color .2s;
}
.feature-card:hover { border-color: var(--border-2); }
.feature-icon { font-size: 1.5rem; margin-bottom: .75rem; }
.feature-card h3 { font-size: .92rem; font-weight: 600; margin-bottom: .4rem; }
.feature-card p  { font-size: .82rem; color: var(--text-dim); line-height: 1.65; }
.dl-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  text-align: center;
  color: var(--text-dark);
  font-size: .75rem;
  font-family: var(--mono);
}

/* ── Admin layout ── */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
}
.sidebar-logo {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo .name { font-weight: 600; font-size: .9rem; }
.sidebar-logo .tag  { font-size: .62rem; color: var(--text-dark); font-family: var(--mono); }
.sidebar-nav { flex: 1; padding: 1rem .75rem; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 7px;
  font-size: .85rem; color: var(--text-dim);
  border: 1px solid transparent;
  cursor: pointer; transition: all .15s;
  text-decoration: none;
}
.nav-item.active, .nav-item:hover { background: #131720; border-color: var(--border); color: var(--text); }
.sidebar-bottom { padding: .75rem; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.admin-main { flex: 1; display: flex; flex-direction: column; overflow: auto; }
.topbar {
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg);
  position: sticky; top: 0; z-index: 10;
}
.topbar-title { font-size: .9rem; font-weight: 500; color: var(--text-muted); }
.admin-body { padding: 1.5rem; flex: 1; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.25rem; }
.stat-label { font-size: .66rem; color: var(--text-dark); text-transform: uppercase; letter-spacing: .1em; font-family: var(--mono); }
.stat-val   { font-size: 1.6rem; font-weight: 700; line-height: 1; margin-top: .3rem; }
.filters { display: flex; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filters .input { max-width: 320px; }
.count-info { font-size: .72rem; color: var(--text-dark); font-family: var(--mono); margin-top: .75rem; }

/* ── Admin login ── */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  position: relative; overflow: hidden;
}
.grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(26,34,53,.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,34,53,.3) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.login-card { position: relative; width: 100%; max-width: 380px; }
.login-logo { text-align: center; margin-bottom: 2.5rem; }
.login-logo .mark {
  width: 50px; height: 50px; border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 22px; color: #fff;
  box-shadow: 0 0 30px rgba(6,182,212,.2);
  margin-bottom: 1rem;
}
.login-logo h1 { font-size: 1.1rem; font-weight: 600; letter-spacing: -.02em; }
.login-logo p  { font-size: .75rem; color: var(--text-dark); font-family: var(--mono); margin-top: .25rem; }
.form-group { margin-bottom: 1.25rem; }
.back-link {
  display: block; text-align: center; margin-top: 1.5rem;
  font-size: .78rem; color: var(--text-dark); font-family: var(--mono);
  transition: color .15s;
}
.back-link:hover { color: var(--text-dim); }

@media (max-width: 700px) {
  .sidebar { width: 64px; }
  .sidebar-logo .name, .sidebar-logo .tag, .nav-item span { display: none; }
  .admin-body { padding: 1rem; }
}


/* Colores por rol */
.role-Reseller { border-color: #00b894 !important; color: #00b894; }
.role-Distributor { border-color: #0984e3 !important; color: #0984e3; }
.role-WebOwner { border-color: #6c5ce7 !important; color: #6c5ce7; }

.reseller-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid; /* El color se aplica por clase */
}

.reseller-card:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.flag-icon {
    width: 24px;
    height: 16px;
    margin-left: 5px;
    vertical-align: middle;
}

/* ── Tarjeta Metálica Premium ── */
.metal-card {
    background: linear-gradient(145deg, #0b151a, #070d10);
    border: 2px solid #2e3b44;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    transition: transform 0.3s ease;
    /* La variable --accent será definida por la clase del rango */
}

.metal-card:hover { transform: translateY(-5px); }

/* Definición de colores por rango para el tema metálico */
.role-Reseller    { --accent: #00b894; }
.role-Distributor { --accent: #0984e3; }
.role-WebOwner    { --accent: #6c5ce7; }

/* Borde y elementos de acento basados en el rango */
.metal-card {
    background: #0d0d15;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    position: relative; /* Esencial para el posicionamiento absoluto del hijo */
    min-height: 400px;  /* Altura mínima para que siempre tengan el mismo tamaño */
    padding-bottom: 70px; /* Padding extra para que el contenido no tape el rango */
}

.reseller-logo { 
    width: 90px; height: 90px; border-radius: 50%; 
    border: 3px solid var(--accent);
    object-fit: cover;
    margin-bottom: 15px;
}

/* Panel de pagos estilizado */
.payments-panel {
    background: #0d171d;
    border: 1px solid #1a2a35;
    border-radius: 12px;
    padding: 15px;
    margin: 20px auto;
    width: 90%; /* Ajusta el ancho total del panel */
}

.payments-grid {
    display: flex;
    flex-wrap: wrap; /* Permite que salten a la siguiente línea si no caben */
    justify-content: center;
    gap: 8px; /* Espacio entre botones */
    margin-top: 10px;
}

.payment-btn {
    flex: 1 1 30%; /* Cada botón ocupa aprox 30% del ancho, ajusta según necesites */
    min-width: 60px; /* Tamaño mínimo para que no se vean muy pequeños */
    background: linear-gradient(180deg, #d4af37, #997d25);
    color: #000;
    padding: 6px 8px; /* Reducimos el padding para hacerlo más corto */
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    text-align: center;
    cursor: default;
}

/* Barra inferior */
.rank-bar {
    position: absolute; /* Anclado a la base */
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    border-top: 1px solid var(--accent);
    border-radius: 0 0 20px 20px;
    font-weight: 700;
    color: var(--accent);
    background: #0a0a10; /* Color de fondo base */
}

.action-icons {
    display: flex; 
    justify-content: center; 
    gap: 20px; 
    margin: 20px 0;
    font-size: 1.3rem;
}


/* Botón dorado animado Main Distributor*/
.holo-card {
    position: relative;
    background: #0d0d15;
    border-radius: 20px;
    padding: 35px;
    display: flex;
    align-items: center;
    gap: 30px;
    color: white;
    overflow: hidden;
    transition: all 0.4s ease;
    border: none; /* <--- CAMBIA ESTO: Quita el borde sólido */
    z-index: 1;
}

/* Efecto Hover: Zoom + Brillo Dorado Intenso */
.holo-card:hover {
    transform: scale(1.02);
    border-color: #ffd700; /* Dorado intenso */
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.4); /* Resplandor dorado */
}

/* 1. Capa para el barrido holográfico (Fondo) */
.holo-effect {
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(0deg, transparent, transparent 30%, rgba(90, 62, 145, 0.3));
    transform: rotate(-45deg) translateY(100%);
    transition: all 0.6s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

.holo-card:hover .holo-effect {
    opacity: 1;
    transform: rotate(-45deg) translateY(60%);
}

.holo-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    border: 2px solid rgba(255, 215, 0, 0.15); 
    z-index: 1;
    pointer-events: none;
    transition: border 0.4s ease;
}

/* 2. Líneas animadas (CAPA SUPERIOR ABSOLUTA) */
.holo-card::after {
    content: '';
    position: absolute;
    inset: 0; /* Cambiado de -2px a 0 para que coincida con el borde base */
    border-radius: 20px;
    padding: 2px; /* Esto crea el grosor del borde */
    background: linear-gradient(90deg, #ffd700 0%, transparent 20%, #ffd700 40%, transparent 100%);
    background-size: 200% 100%;
    /* La máscara necesita coincidir con el border-radius del padre */
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: trace-border 4s linear infinite;
    z-index: 2; /* Suficiente si el contenido tiene z-index 1 o está dentro de un div con z-index */
    pointer-events: none;
}

@keyframes trace-border {
    0% { background-position: 100% 0; }
    100% { background-position: 0% 0; }
}



/* TELEGRAM */

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7), inset 0 0 15px rgba(56, 189, 248, 0.2);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 25px 8px rgba(56, 189, 248, 0.5), inset 0 0 25px rgba(56, 189, 248, 0.4);
        transform: scale(1.03);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0), inset 0 0 15px rgba(56, 189, 248, 0.2);
        transform: scale(1);
    }
}

.telegram-btn-impact {
    animation: pulse-glow 2s infinite ease-in-out;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(15, 23, 42, 0.8));
    border: 1.5px solid #38bdf8 !important;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: sans-serif;
}

.telegram-btn-impact svg {
    width: 20px;
    height: 20px;
    fill: #38bdf8;
}

.telegram-btn-impact:hover {
    animation: none;
    box-shadow: 0 0 30px 10px rgba(56, 189, 248, 0.8), inset 0 0 20px rgba(56, 189, 248, 0.5);
    transform: scale(1.05);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.3), rgba(15, 23, 42, 0.9));
}