/* Estilos de la página de conexión WhatsApp (whatsapp.html) */

body { min-height: 100%; }

/* ── Header ── */
.header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px 14px;
  background: rgba(12,12,15,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.back-btn {
  width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--card);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none; flex-shrink: 0;
}
.header-title { font-family: 'DM Serif Display', serif; font-size: 19px; color: var(--text); }

.page-body { padding: 20px 18px 48px; }

/* ── Tarjeta de estado ── */
.status-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; padding: 18px; margin-bottom: 20px;
  display: flex; align-items: center; gap: 14px; transition: border-color 0.3s;
}
.status-card.st-ready  { border-color: rgba(37,211,102,0.35); }
.status-card.st-active { border-color: rgba(200,241,53,0.25); }
.status-icon { width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.status-info { flex: 1; min-width: 0; }
.status-title { font-size: 15px; font-weight: 600; color: var(--text); }
.status-sub   { font-size: 13px; color: var(--muted); margin-top: 1px; }
.status-dot   { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-ready   { background: var(--green); box-shadow: 0 0 8px rgba(37,211,102,0.5); }
.dot-active  { background: var(--accent); animation: blink 1.4s ease-in-out infinite; }
.dot-loading { background: var(--muted); animation: blink 1.2s ease-in-out infinite; }
.dot-off     { background: var(--muted2); }

/* ── Secciones condicionales ── */
.section { display: none; }
.section.visible { display: block; }

/* ── Tabs de método (código / QR) ── */
.method-tabs {
  display: flex; background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 4px; margin-bottom: 20px; gap: 4px;
}
.method-tab {
  flex: 1; padding: 9px; border-radius: 11px;
  font-size: 13px; font-weight: 500; color: var(--muted);
  cursor: pointer; text-align: center; transition: all 0.15s;
  border: none; background: transparent; font-family: 'DM Sans', sans-serif;
}
.method-tab.active { background: var(--surface); color: var(--text); border: 1px solid var(--border); }

/* ── Sección de código numérico ── */
.phone-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; padding: 20px; margin-bottom: 16px;
}
.form-label {
  font-size: 12px; font-weight: 500; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 8px; display: block;
}
.phone-row { display: flex; gap: 9px; }
.phone-input {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 11px 13px;
  font-family: 'DM Sans', sans-serif; font-size: 15px; color: var(--text);
  outline: none; transition: border-color 0.15s; -webkit-appearance: none;
}
.phone-input:focus { border-color: rgba(200,241,53,0.5); }
.phone-input::placeholder { color: var(--muted2); }
.btn-send {
  padding: 11px 18px; border-radius: 12px; border: none; cursor: pointer;
  background: var(--accent); color: #000;
  font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 600;
  white-space: nowrap; transition: opacity 0.15s; flex-shrink: 0;
}
.btn-send:active   { opacity: 0.8; }
.btn-send:disabled { opacity: 0.4; cursor: not-allowed; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.5; }

/* ── Tarjeta de código generado ── */
.code-card {
  background: var(--card); border: 1px solid rgba(200,241,53,0.2);
  border-radius: 18px; padding: 24px 20px; margin-bottom: 16px; text-align: center;
}
.code-label  { font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px; }
.code-digits { font-family: 'DM Serif Display', serif; font-size: 42px; letter-spacing: 8px; color: var(--accent); margin-bottom: 16px; }
.steps-list  { text-align: left; display: flex; flex-direction: column; }
.step-row    { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.step-row:last-child { border-bottom: none; }
.step-num {
  width: 22px; height: 22px; border-radius: 6px;
  background: rgba(200,241,53,0.1); color: var(--accent);
  font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.step-text { font-size: 13px; color: var(--muted); line-height: 1.5; }
.step-text strong { color: var(--text); font-weight: 500; }

/* ── Sección QR ── */
.qr-center { display: flex; justify-content: center; margin-bottom: 16px; }
.qr-box    { background: #fff; border-radius: 20px; padding: 14px; display: inline-flex; }
.qr-box img { width: 210px; height: 210px; display: block; }
.steps-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; margin-bottom: 14px; }

/* ── Spinner / loading ── */
.center-box  { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 32px 0; text-align: center; }
.spinner     { width: 44px; height: 44px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
.center-text { font-size: 14px; color: var(--muted); }

/* ── Estado conectado ── */
.ready-box  { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px 0 8px; text-align: center; }
.ready-icon { width: 76px; height: 76px; border-radius: 22px; background: var(--green-bg); display: flex; align-items: center; justify-content: center; font-size: 36px; }
.ready-title { font-family: 'DM Serif Display', serif; font-size: 22px; color: var(--text); }
.ready-sub   { font-size: 14px; color: var(--muted); max-width: 250px; line-height: 1.6; }

/* ── Botón peligroso ── */
.btn-danger {
  width: 100%; padding: 14px; border-radius: 14px;
  border: 1px solid rgba(255,77,77,0.2); background: var(--danger-bg); color: var(--danger);
  font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s; margin-top: 8px;
}
.btn-danger:active { opacity: 0.7; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 12px;
  font-size: 13px; font-weight: 500;
  opacity: 0; transition: all 0.25s;
  pointer-events: none; z-index: 100;
  white-space: nowrap; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
