/* ============================= */
/* RESET + BASE                  */
/* ============================= */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #0f172a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #e5e7eb;
}

/* ============================= */
/* SCREEN FULLSCREEN NATIVO      */
/* ============================= */

.screen {
  position: fixed;
  inset: 0;
  display: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  padding:
    env(safe-area-inset-top, 24px)
    20px
    env(safe-area-inset-bottom, 24px);
}

.screen.active {
  display: block;
}

/* ============================= */
/* CONTENIDO INTERNO             */
/* ============================= */

.screen-content {
  min-height: 100%;
  max-width: 420px;
  margin: 0 auto;

  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ============================= */
/* TEXTOS                        */
/* ============================= */

h1, h2 {
  text-align: center;
  margin-bottom: 8px;
}

.subtitle {
  text-align: center;
  opacity: 0.7;
  margin-bottom: 20px;
}

.hint {
  text-align: center;
  font-size: 12px;
  opacity: 0.6;
  margin-top: 10px;
}

/* ============================= */
/* INPUTS                        */
/* ============================= */

input {
  width: 100%;
  padding: 14px;
  margin-bottom: 14px;
  border-radius: 10px;
  border: none;
  font-size: 16px;
}

/* ============================= */
/* SELECT (PLAN)                 */
/* ============================= */

select {
  width: 100%;
  padding: 14px;
  margin-bottom: 14px;
  border-radius: 10px;
  border: none;
  font-size: 16px;
  background: #020617;
  color: #e5e7eb;
}

/* ============================= */
/* BOTONES                       */
/* ============================= */

button {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: #2563eb;
  color: white;
  font-size: 16px;
  cursor: pointer;
}

button:active {
  background: #1d4ed8;
}

/* BOTÓN SECUNDARIO (COMPRAR ACCESO) */

.secondary-btn {
  margin-top: 10px;
  background: transparent;
  border: 1px solid #64748b;
  color: #e5e7eb;
}

/* ============================= */
/* PERFIL                        */
/* ============================= */

.profile-selector {
  display: flex;
  gap: 10px;
  margin: 14px 0;
}

.profile-btn {
  flex: 1;
  background: #020617;
  border: 1px solid #334155;
  padding: 10px;
  border-radius: 10px;
  color: #e5e7eb;
}

.profile-btn.active {
  background: #2563eb;
  border-color: #2563eb;
}

.perfil-activo {
  text-align: center;
  font-size: 13px;
  opacity: 0.8;
  margin-bottom: 16px;
}

/* ============================= */
/* RESULTADO CRECIENTE           */
/* ============================= */

.result {
  margin-top: 20px;
  padding: 16px;
  background: #020617;
  border-radius: 12px;
  border: 1px solid #334155;
}

.flag {
  text-align: center;
  font-weight: bold;
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.flag.yellow { background: #ca8a04; }
.flag.green  { background: #16a34a; }
.flag.red {
  background: #dc2626; /* rojo real */
  color: #ffffff;
}

.hidden {
  display: none;
}

/* ============================= */
/* LEGAL                         */
/* ============================= */

.legal {
  margin-top: auto;
  text-align: center;
  font-size: 11px;
  opacity: 0.5;
  padding-top: 20px;
}

/* ========================= */
/* AUTOCOMPLETE TIPO BROKER */
/* ========================= */

#suggestions {
  position: relative;
  margin-top: 6px;
  border-radius: 10px;
  background: #020617;
  border: 1px solid #334155;
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
  overflow: hidden;
  z-index: 999; /* CRÍTICO en iOS */
}

#suggestions.hidden {
  display: none;
}

.suggestion-item {
  padding: 12px 14px;
  font-size: 15px;
  color: #e5e7eb;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item:active {
  background: rgba(37, 99, 235, 0.25);
}

/* ============================= */
/* CAJA DATOS BANCARIOS          */
/* ============================= */

.bank-box {
  margin: 15px 0;
  padding: 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px dashed #64748b;
  font-size: 14px;
  line-height: 1.4;
}

/* ============================= */
/* MENSAJE CONFIRMACIÓN PAGO     */
/* ============================= */

#payment-msg {
  margin-top: 12px;
  font-size: 13px;
  text-align: center;
  color: #93c5fd;
}

/* =============================
   QR CoDi – PAGO
============================= */

.qr-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.qr-image {
  width: 100%;
  max-width: 280px;
  height: auto;
  background: #ffffff;
  padding: 10px;
  border-radius: 12px;
}

/* =============================
   FIX BOTÓN INFERIOR iOS
============================= */

#payment-info-screen .screen-content {
  justify-content: flex-start; /* ⛔ no center aquí */
}

#paid-btn {
  margin-top: 24px;
  margin-bottom: calc(24px + env(safe-area-inset-bottom));
}

.price-note {
  margin-top: 6px;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}

/* =============================
   LOGIN – AJUSTE DE BOTONES
============================= */

#login-screen .screen-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;   /* 🔥 distribuye verticalmente */
  align-items: center;
  min-height: 100%;
  padding-top: 60px;
  padding-bottom: 60px;
}



/* Botón ACCEDER */
#login-btn {
  width: auto;                 /* 🔑 rompe el 100% */
  padding: 12px 28px;
  margin-top: 22px;
  align-self: center;
}

/* Botón COMPRAR ACCESO */
#buy-access-btn {
  width: auto;                 /* 🔑 rompe el 100% */
  padding: 10px 24px;
  margin-top: 64px;            /* más abajo */
  align-self: center;
}

/* Texto “Acceso controlado” */
#login-screen .hint {
  margin-top: 16px;
  font-size: 12px;
  opacity: 0.6;
  text-align: center;
}

.back-btn {
  width: auto;              /* 👈 clave */
  align-self: center;       /* centra el botón */
  padding: 12px 20px;
  margin-top: auto;
  background: #2563eb;
  border-radius: 12px;
  font-size: 15px;
}

/* ===============================
   ESTILO DE RIESGO (IGUAL A PERFIL)
=============================== */

.risk-style-buttons {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.risk-style-btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #2c3e50;
  background: #0b1320;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.risk-style-btn.active {
  background: #2563eb;   /* mismo azul que PERFIL */
  border-color: #2563eb;
}

/* ============================= */
/* BOTÓN DEMO                    */
/* ============================= */

#demo-btn {
  width: auto;                /* mismo comportamiento que login */
  padding: 12px 28px;
  align-self: center;
  margin-bottom: 28px;        /* espacio antes del login */
}

#login-screen h1 {
  margin-bottom: 16px;
}

#login-screen .subtitle {
  margin-bottom: 28px;
  max-width: 340px;
  text-align: center;
  line-height: 1.5;
}

#login-email {
  margin-top: 24px;
}

.secondary-btn {
  margin-top: 16px;
  padding: 14px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid #3b82f6;
  background-color: transparent;
  color: #3b82f6;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.2s ease;
  cursor: pointer;
}

/* ===== Install Banner ===== */
.install-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  z-index: 9999;
  width: 90%;
  max-width: 420px;
  transition: all 0.3s ease;
}

.install-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  font-size: 14px;
}

.install-content button {
  background: #3b82f6;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  cursor: pointer;
}

.install-content button:hover {
  background: #2563eb;
}

/* ===== Modal ===== */
.install-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.install-modal-box {
  background: #0f172a;
  padding: 28px;
  border-radius: 16px;
  width: 90%;
  max-width: 420px;
  text-align: center;
  color: #fff;
}

.install-modal-box h3 {
  margin-bottom: 16px;
}

.install-modal-box ol {
  text-align: left;
  margin-bottom: 20px;
}

.install-modal-box button {
  background: #3b82f6;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
}

.hidden {
  display: none;
}

/* =============================
   BOTÓN UPGRADE PREMIUM
============================= */

.primary-btn {
  background: #D4AF37;   /* dorado elegante */
  color: #111827;
  font-weight: 600;
  transition: 0.2s ease;
}

.primary-btn:hover {
  background: #e6c65c;
}

.renew-btn {
  margin-top: 12px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
}

.subscription-info {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0.9;
  text-align: center;     /* 👈 esto la centra */
}

.subscription-info.active {
  color: #4ade80;
}

.subscription-info.warning {
  color: #facc15;
}

.subscription-info.expired {
  color: #f87171;
}