/* ==========================================================================
   COPILOTO IA PARA ASESORES - JULIÁN PELUSO
   Estilo: Dark Luxury (Verde Esmeralda y Negro Profundo)
   ========================================================================== */

:root {
  --bg-main: #06110e;
  --bg-surface: #0a1713;
  --bg-card: #0e1e19;
  --bg-card-hover: #132721;
  --bg-input: #081410;
  
  --accent-primary: #677c5d;
  --accent-bright: #10b981;
  --accent-light: #34d399;
  --accent-glow: rgba(103, 124, 93, 0.25);
  --accent-subtle: rgba(103, 124, 93, 0.12);
  --accent-border: rgba(103, 124, 93, 0.22);
  
  --text-main: #ffffff;
  --text-muted: #94a3b8;
  --text-emerald: #a7f3d0;
  --text-dim: #64748b;

  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);

  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(103, 124, 93, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(103, 124, 93, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 85%, rgba(16, 185, 129, 0.1) 0%, transparent 45%);
}

/* ==========================================================================
   APP HEADER
   ========================================================================== */
.copilot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(10, 23, 19, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--accent-border);
  z-index: 50;
  flex-shrink: 0;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #040c09;
  border: 1.5px solid var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: none;
  box-shadow: none;
  border-radius: 6px;
}

.brand-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.brand-info h1 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  line-height: 1.15;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--accent-light);
  font-weight: 600;
  margin: 0;
  line-height: 1.15;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-bright);
  box-shadow: 0 0 8px var(--accent-bright);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-session-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(103, 124, 93, 0.12);
  border: 1px solid var(--accent-border);
  padding: 4px 10px 4px 6px;
  border-radius: var(--radius-full);
  box-shadow: 0 0 10px rgba(103, 124, 93, 0.1);
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
}

.user-session-badge:hover {
  background: rgba(103, 124, 93, 0.2);
  border-color: var(--accent-primary);
}

.user-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #677c5d, #10b981);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  box-shadow: 0 0 8px var(--accent-glow);
}

.user-session-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-session-name {
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-session-role {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.btn-icon-header {
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-icon-header:hover {
  background: var(--accent-subtle);
  color: var(--accent-light);
  border-color: var(--accent-primary);
}

/* ==========================================================================
   QUICK SUGGESTIONS BAR
   ========================================================================== */
.suggestions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
  white-space: nowrap;
  background: rgba(6, 17, 14, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  scrollbar-width: none;
  flex-shrink: 0;
}

.suggestions-bar::-webkit-scrollbar {
  display: none;
}

.suggestion-chip {
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  color: var(--text-emerald);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  user-select: none;
}

.suggestion-chip:hover {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 10px var(--accent-glow);
  transform: translateY(-1px);
}

/* ==========================================================================
   CHAT MESSAGES FEED
   ========================================================================== */
.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.welcome-box {
  background: linear-gradient(135deg, rgba(103, 124, 93, 0.12), rgba(6, 17, 14, 0.95));
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  max-width: 520px;
  margin: 10px auto 20px auto;
  box-shadow: var(--shadow-sm);
}

.welcome-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-subtle);
  border: 1.5px solid var(--accent-primary);
  color: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px auto;
}

.welcome-box h2 {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
}

.welcome-box p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.message-row {
  display: flex;
  gap: 10px;
  max-width: 92%;
  animation: message-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes message-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-row.user-row {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-row.bot-row {
  align-self: flex-start;
}

.avatar-copilot {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #677c5d, #065f46);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.message-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 13.5px;
  line-height: 1.55;
  position: relative;
  word-break: break-word;
}

.user-row .message-bubble {
  background: linear-gradient(135deg, rgba(103, 124, 93, 0.25), rgba(6, 95, 70, 0.35));
  border: 1px solid var(--accent-primary);
  color: #ffffff;
  border-top-right-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.bot-row .message-bubble {
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  color: var(--text-main);
  border-top-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.message-meta {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-row .message-meta {
  justify-content: flex-end;
  color: var(--accent-light);
}

/* Audio Player Bubble */
.audio-player-bubble {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.btn-play-voice {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.btn-play-voice:hover {
  background: var(--accent-bright);
  transform: scale(1.05);
}

.voice-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 24px;
}

.wave-bar {
  width: 3px;
  height: 8px;
  background: var(--accent-light);
  border-radius: 2px;
  transition: height 0.15s ease;
}

.playing .wave-bar:nth-child(2n) { animation: wave-anim 0.5s infinite alternate ease-in-out; }
.playing .wave-bar:nth-child(2n+1) { animation: wave-anim 0.5s 0.25s infinite alternate ease-in-out; }

@keyframes wave-anim {
  0% { height: 6px; }
  100% { height: 22px; }
}

/* ==========================================================================
   CARDS & RICH INTERFACES
   ========================================================================== */
.rich-lead-card {
  margin-top: 10px;
  background: rgba(103, 124, 93, 0.12);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lead-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(103, 124, 93, 0.2);
  padding-bottom: 6px;
}

.lead-card-header h4 {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.lead-tag {
  background: var(--accent-primary);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.lead-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 12px;
}

.lead-card-item {
  display: flex;
  flex-direction: column;
}

.lead-card-item label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.lead-card-item span {
  color: #ffffff;
  font-weight: 600;
}

.lead-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.btn-lead-action {
  flex: 1;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-lead-wa {
  background: #25d366;
  color: #ffffff;
}

.btn-lead-wa:hover {
  background: #1eb956;
}

.btn-lead-call {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--accent-border);
}

.btn-lead-call:hover {
  background: var(--accent-subtle);
  border-color: var(--accent-primary);
}

/* Copy WhatsApp Card */
.copy-wa-box {
  margin-top: 10px;
  background: rgba(37, 211, 102, 0.08);
  border: 1px solid rgba(37, 211, 102, 0.3);
  border-radius: var(--radius-md);
  padding: 10px;
}

.btn-copy-wa {
  background: #25d366;
  color: #ffffff;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
}

/* ==========================================================================
   INPUT BAR & MIC MODE SEGMENTED CONTROL
   ========================================================================== */
.copilot-input-container {
  padding: 10px 14px 14px 14px;
  background: rgba(10, 23, 19, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--accent-border);
  z-index: 50;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Segmented Mic Mode Toolbar */
.mic-mode-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px;
  gap: 8px;
}

.mic-mode-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.mic-mode-segmented {
  display: inline-flex;
  align-items: center;
  background: rgba(6, 17, 14, 0.9);
  border: 1px solid var(--accent-border);
  padding: 3px;
  border-radius: var(--radius-full);
  gap: 3px;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5);
}

.mic-seg-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.mic-seg-btn:hover {
  color: #ffffff;
}

.mic-seg-btn.active {
  background: linear-gradient(135deg, #677c5d, #065f46);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  position: relative;
}

.btn-attach {
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  color: var(--accent-light);
}

.btn-attach:hover {
  background: var(--accent-subtle);
  border-color: var(--accent-primary);
}

.text-input-wrapper {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--accent-border);
  border-radius: 24px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  min-height: 46px;
}

.text-input-wrapper:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px var(--accent-glow);
}

.chat-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  resize: none;
  max-height: 100px;
  line-height: 1.4;
}

.chat-input::placeholder {
  color: var(--text-dim);
}

.action-btn-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-action-round {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  border: none;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.btn-mic {
  background: linear-gradient(135deg, #677c5d, #065f46);
  color: #ffffff;
  box-shadow: 0 3px 12px var(--accent-glow);
}

.btn-mic:hover {
  transform: scale(1.06);
  box-shadow: 0 0 20px rgba(103, 124, 93, 0.4);
}

.btn-mic.holding, .btn-mic.active-recording {
  background: #ef4444 !important;
  transform: scale(1.18);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.6) !important;
  animation: pulse-recording 1.2s infinite;
}

.btn-send {
  background: var(--accent-primary);
  color: #ffffff;
  display: none;
}

.btn-send.active {
  display: flex;
}

/* Grabación de Audio Activa */
.recording-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% - 56px);
  height: 100%;
  background: #0d1e18;
  border: 1px solid rgba(239, 68, 68, 0.6);
  border-radius: 24px;
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 10;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

@keyframes pulse-recording {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}

.recording-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ef4444;
  font-weight: 800;
  font-size: 13px;
}

.recording-dot {
  width: 10px;
  height: 10px;
  background-color: #ef4444;
  border-radius: 50%;
  animation: blink 0.8s infinite alternate;
}

@keyframes blink {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0.2; transform: scale(0.85); }
}

.live-audio-waveform {
  display: flex;
  align-items: center;
  gap: 2.5px;
  height: 18px;
  margin-left: 4px;
}

.live-bar {
  width: 3px;
  height: 6px;
  background: #ef4444;
  border-radius: 2px;
  animation: live-bar-anim 0.6s infinite alternate ease-in-out;
}

.live-bar:nth-child(1) { animation-delay: 0.1s; }
.live-bar:nth-child(2) { animation-delay: 0.25s; }
.live-bar:nth-child(3) { animation-delay: 0.4s; }
.live-bar:nth-child(4) { animation-delay: 0.15s; }
.live-bar:nth-child(5) { animation-delay: 0.3s; }

@keyframes live-bar-anim {
  0% { height: 4px; }
  100% { height: 18px; }
}

.recording-slide-hint {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-muted);
  animation: slide-pulse 1.8s infinite ease-in-out;
}

@keyframes slide-pulse {
  0%, 100% { opacity: 0.5; transform: translateX(0); }
  50% { opacity: 1; transform: translateX(-6px); }
}

.recording-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-cancel-rec {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel-rec:hover {
  background: #ef4444;
  color: white;
}

.btn-send-rec {
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent-glow);
}

.btn-send-rec:hover {
  background: var(--accent-bright);
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-light);
  border-radius: 50%;
  animation: typing-dot 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-dot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.3; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* Modal Selector */
.copilot-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.copilot-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  max-width: 440px;
  width: 100%;
  padding: 22px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: message-in 0.25s ease-out;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.modal-icon-alert {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(103, 124, 93, 0.15);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 3px;
}

.modal-header p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.modal-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-modal-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent-border);
  background: var(--bg-surface);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-modal-opt:hover {
  background: var(--accent-subtle);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.btn-modal-opt.primary {
  background: rgba(103, 124, 93, 0.15);
  border-color: var(--accent-primary);
}

.btn-modal-opt strong {
  display: block;
  font-size: 13px;
  color: var(--accent-light);
  margin-bottom: 2px;
}

.btn-modal-opt span {
  font-size: 11px;
  color: var(--text-muted);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
}

.btn-modal-close {
  background: transparent;
  border: 1px solid var(--accent-border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-modal-close:hover {
  color: #ffffff;
  border-color: var(--text-muted);
}

/* Toast Notifications */
.copilot-toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(10, 23, 19, 0.95);
  border: 1px solid var(--accent-primary);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 15px var(--accent-glow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  max-width: 90vw;
}

.copilot-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 480px) {
  .copilot-header {
    padding: 10px 12px;
  }
  .brand-info h1 {
    font-size: 14px;
  }
  .message-row {
    max-width: 96%;
  }
  .chat-container {
    padding: 12px;
  }
  .mic-mode-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .mic-mode-segmented {
    width: 100%;
    justify-content: space-between;
  }
  .mic-seg-btn {
    flex: 1;
    justify-content: center;
    padding: 6px 8px;
    font-size: 11px;
  }
}

/* TTS Voice Button & Bubble Controls */
.tts-header-btn {
  position: relative;
  transition: all 0.2s ease;
}

.tts-header-btn.active {
  border-color: var(--accent-primary);
  background: rgba(103, 124, 93, 0.15);
  box-shadow: 0 0 10px var(--accent-glow);
}

.tts-header-btn.speaking {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.25) !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.6) !important;
  animation: pulse-speaking 1.2s infinite ease-in-out;
}

@keyframes pulse-speaking {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.85);
  }
}

.tts-header-btn.muted {
  border-color: rgba(255, 255, 255, 0.08);
  background: var(--bg-card);
}

.bubble-tts-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(103, 124, 93, 0.1);
  border: 1px solid var(--accent-border);
  color: var(--accent-light);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  transition: all 0.2s ease;
  user-select: none;
}

.bubble-tts-action:hover {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.bubble-tts-action.speaking {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
  animation: pulse-speaking 1.5s infinite;
}

@keyframes pulse-speaking {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

/* Mic Permission Banner */
.mic-perm-banner {
  background: linear-gradient(135deg, rgba(103, 124, 93, 0.25), rgba(6, 17, 14, 0.95));
  border-bottom: 1.5px solid var(--accent-primary);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  animation: slide-down 0.3s ease-out;
  z-index: 45;
  flex-shrink: 0;
}

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.mic-perm-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mic-perm-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(103, 124, 93, 0.2);
  border: 1px solid var(--accent-primary);
  color: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: pulse-mic 2s infinite;
}

@keyframes pulse-mic {
  0%, 100% { box-shadow: 0 0 0 0 rgba(103, 124, 93, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(103, 124, 93, 0); }
}

.mic-perm-text {
  display: flex;
  flex-direction: column;
}

.mic-perm-text strong {
  font-size: 13px;
  color: #ffffff;
  font-weight: 800;
}

.mic-perm-text span {
  font-size: 11px;
  color: var(--accent-emerald);
}

.btn-enable-mic {
  background: linear-gradient(135deg, #677c5d, #10b981);
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px var(--accent-glow);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-enable-mic:hover {
  background: #10b981;
  transform: scale(1.03);
}

/* Unlock Modal Styles */
.mic-unlock-card {
  max-width: 460px;
}

.unlock-steps-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 6px 0;
}

.unlock-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.step-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.step-text strong {
  font-size: 12.5px;
  color: #ffffff;
}

.step-text span {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

.chrome-icon-badge {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
  margin: 0 2px;
}

.unlock-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.btn-unlock-primary {
  background: linear-gradient(135deg, #677c5d, #10b981);
  color: #ffffff;
  border: none;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 12px var(--accent-glow);
  transition: all 0.2s ease;
}

.btn-unlock-primary:hover {
  background: #10b981;
  transform: translateY(-1px);
}

.btn-unlock-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--accent-border);
  color: var(--accent-light);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-unlock-secondary:hover {
  background: var(--accent-subtle);
  border-color: var(--accent-primary);
}


/* ==========================================================================
   BARRA DE MODO DE AUDIO (SEGMENTED CONTROL) & BOTONES INFERIORES
   ========================================================================== */
.audio-mode-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 18px 8px 18px;
  background: transparent;
}

.mode-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-light);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 4px;
}

.mode-segmented-control {
  display: inline-flex;
  background: rgba(14, 30, 25, 0.95);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 3px;
}

.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
}

.seg-btn span svg, .seg-btn svg {
  width: 12px;
  height: 12px;
}

.seg-btn:hover {
  color: var(--text-main);
}

.seg-btn.active {
  background: linear-gradient(135deg, #677c5d, #10b981);
  color: #ffffff;
  box-shadow: 0 2px 10px var(--accent-glow);
}

/* Alineación de la barra de entrada */
.input-section {
  background: rgba(10, 23, 19, 0.95);
  border-top: 1px solid var(--accent-border);
  padding: 6px 14px 12px 14px;
  flex-shrink: 0;
  position: relative;
  z-index: 40;
}

.input-bar-container {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  width: 100%;
}

.text-input-wrapper {
  flex: 1;
  background: var(--bg-input);
  border: 1.5px solid var(--accent-border);
  border-radius: 24px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  min-height: 44px;
}

.text-input-wrapper:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 14px var(--accent-glow);
}

.chat-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 14px;
  resize: none;
  outline: none;
  max-height: 100px;
  line-height: 1.4;
  display: block;
}

.btn-voice-record, .btn-mic {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #677c5d, #10b981) !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  border: none;
  box-shadow: 0 3px 14px var(--accent-glow);
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.btn-voice-record.active-recording, .btn-voice-record.holding,
.btn-mic.active-recording, .btn-mic.holding {
  background: #ef4444 !important;
  transform: scale(1.15);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.7) !important;
  animation: pulse-recording 1.2s infinite;
}

.btn-send-text, .btn-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-primary) !important;
  color: #ffffff !important;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  border: none;
  box-shadow: 0 3px 14px var(--accent-glow);
  outline: none;
}

.btn-send-text.active, .btn-send.active {
  display: flex !important;
}

/* Modal de Asesores con estética pulida */
.copilot-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 10, 8, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 18px;
}

.copilot-modal-card {
  background: var(--bg-card);
  border: 1.5px solid var(--accent-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md), var(--shadow-glow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: modal-fade-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-modal-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(14, 30, 25, 0.6);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-family);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-modal-opt:hover, .btn-modal-opt.primary {
  background: rgba(103, 124, 93, 0.15);
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-glow);
}

.btn-modal-opt strong {
  display: block;
  font-size: 13.5px;
  color: var(--text-main);
}

.btn-modal-opt span {
  font-size: 11px;
  color: var(--accent-light);
}

.btn-modal-close {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, #677c5d, #10b981);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

/* Botón de reproducción de voz en cada burbuja */
.btn-bubble-tts {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: 6px;
}
.btn-bubble-tts:hover {
  color: var(--accent-light);
  background: rgba(16, 185, 129, 0.12);
}
.btn-bubble-tts:active {
  transform: scale(0.92);
}


/* ==========================================================================
   PANTALLA DE BIENVENIDA / CARGA LUXURY (SPLASH SCREEN)
   ========================================================================== */
.splash-screen-wrapper {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #06110e;
  background: radial-gradient(circle at 50% 35%, #0d271f 0%, #06110e 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 1;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash-screen-wrapper.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 360px;
  width: 100%;
  animation: splashFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes splashFadeIn {
  0% { opacity: 0; transform: translateY(16px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.splash-logo-frame {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  background: linear-gradient(145deg, #0e1e19, #081410);
  border: 2px solid rgba(103, 124, 93, 0.4);
  box-shadow: 0 0 30px rgba(103, 124, 93, 0.25), 0 8px 24px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 18px;
  padding: 8px;
}

.splash-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.splash-brand-name {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin: 0;
  line-height: 1.2;
}

.splash-brand-tagline {
  font-size: 10.5px;
  color: #c59b27;
  font-weight: 700;
  letter-spacing: 1.5px;
  margin-top: 5px;
  text-transform: uppercase;
}

.splash-gold-divider {
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #c59b27, transparent);
  margin: 16px 0;
}

.splash-welcome-title {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 6px;
  line-height: 1.4;
}

.splash-loading-text {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 20px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.splash-progress-track {
  width: 220px;
  height: 5px;
  background: rgba(103, 124, 93, 0.15);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(103, 124, 93, 0.25);
}

@keyframes fillSplashProgress {
  0% { width: 5%; }
  35% { width: 45%; }
  75% { width: 85%; }
  100% { width: 100%; }
}

.splash-progress-fill {
  height: 100%;
  width: 5%;
  background: linear-gradient(90deg, #677c5d, #10b981, #34d399);
  border-radius: 9999px;
  box-shadow: 0 0 14px #10b981;
  animation: fillSplashProgress 1.1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}


/* Formulario de Login de Asesor */
.login-error-alert {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 6px 0;
  animation: splashFadeIn 0.3s ease;
}

.advisor-login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.login-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.login-input-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.login-input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(8, 20, 16, 0.8);
  border: 1px solid rgba(103, 124, 93, 0.25);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.2s ease;
}

.login-input-wrapper:focus-within {
  border-color: var(--accent-bright);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.advisor-login-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #ffffff;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.advisor-login-input::placeholder {
  color: #475569;
}

.btn-toggle-eye {
  background: transparent;
  border: none;
  padding: 0 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-advisor-login-submit {
  background: linear-gradient(135deg, #677c5d, #10b981);
  color: #ffffff;
  border: none;
  padding: 13px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(103, 124, 93, 0.3);
  transition: all 0.2s ease;
  margin-top: 4px;
}

.btn-advisor-login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(103, 124, 93, 0.45);
}

.btn-advisor-login-submit:active {
  transform: scale(0.98);
}


/* ==========================================================================
   PANTALLA COMPLETA DE LOGIN IDÉNTICA A WEB ASESORES / CRM
   ========================================================================== */
.welcome-login-wrapper {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #06110e;
  display: flex;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  overflow: hidden;
}

.welcome-login-wrapper.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.welcome-split-card {
  display: flex;
  width: 100%;
  height: 100%;
  background: #06110e;
}

.welcome-panel-left {
  flex: 1;
  background: radial-gradient(circle at 20% 20%, rgba(103, 124, 93, 0.25) 0%, rgba(8, 30, 24, 0.96) 50%, #06110e 100%);
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
}

@media (max-width: 768px) {
  .welcome-panel-left {
    display: none;
  }
}

.bg-watermark-monogram {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.watermark-svg {
  width: 90%;
  height: 90%;
}

.panel-left-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(103, 124, 93, 0.15);
  border: 1px solid rgba(103, 124, 93, 0.3);
  padding: 6px 14px;
  border-radius: 9999px;
  color: var(--accent-light);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.hero-brand-integrated {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 2;
}

.hero-logo-frame {
  width: 90px;
  height: 90px;
  border-radius: 22px;
  background: #0e1e19;
  border: 2px solid rgba(103, 124, 93, 0.4);
  padding: 8px;
  box-shadow: 0 0 35px rgba(103, 124, 93, 0.3);
  margin-bottom: 18px;
}

.hero-logo-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 14px;
}

.hero-brand-name {
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.hero-brand-tagline {
  font-size: 11px;
  color: #c59b27;
  font-weight: 700;
  letter-spacing: 1.5px;
  margin-top: 6px;
}

.hero-gold-line {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #c59b27, transparent);
  margin-top: 16px;
}

.panel-footer-note {
  font-size: 11px;
  color: var(--text-dim);
}

.welcome-panel-right {
  flex: 1;
  background: #081410;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-box-wrapper {
  max-width: 380px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-form-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.logo-badge-black {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: #040c09;
  border: 1.5px solid rgba(103, 124, 93, 0.35);
  box-shadow: 0 0 20px rgba(103, 124, 93, 0.2);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-badge-black img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.login-main-title {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  margin-top: 2px;
}

.login-sub-brand {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent-light);
  letter-spacing: 1px;
}

.login-alert-box {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modern-login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.field-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.field-input-box {
  display: flex;
  align-items: center;
  background: rgba(4, 12, 9, 0.9);
  border: 1px solid rgba(103, 124, 93, 0.28);
  border-radius: var(--radius-md);
  padding: 0 12px;
  transition: all 0.2s ease;
}

.field-input-box:focus-within {
  border-color: var(--accent-bright);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.25);
}

.field-icon {
  width: 17px;
  height: 17px;
  color: var(--accent-light);
  flex-shrink: 0;
}

.field-input-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: #ffffff;
  padding: 13px 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.field-input-box input::placeholder {
  color: #475569;
}

.btn-toggle-eye {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-login-submit {
  background: linear-gradient(135deg, #677c5d, #10b981);
  color: #ffffff;
  border: none;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(103, 124, 93, 0.35);
  transition: all 0.2s ease;
  margin-top: 4px;
}

.btn-login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(103, 124, 93, 0.5);
}

.btn-login-submit:active {
  transform: scale(0.98);
}


/* ==========================================================================
   PERFECCIONAMIENTO DE CAMPOS DE LOGIN (DARK LUXURY + ANULACIÓN AUTOFILL)
   ========================================================================== */

/* Anular fondo blanco / celeste forzado por Chrome y Android al autocompletar */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #091a14 inset !important;
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #34d399 !important;
  transition: background-color 5000s ease-in-out 0s !important;
  border-radius: 8px !important;
}

.field-input-box {
  display: flex !important;
  align-items: center !important;
  background: #091a14 !important;
  border: 1.5px solid rgba(103, 124, 93, 0.35) !important;
  border-radius: 14px !important;
  padding: 4px 14px !important;
  min-height: 52px !important;
  transition: all 0.25s ease !important;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5) !important;
}

.field-input-box:focus-within {
  border-color: #10b981 !important;
  background: #0d231b !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.35), inset 0 2px 5px rgba(0, 0, 0, 0.5) !important;
}

.field-icon {
  width: 19px !important;
  height: 19px !important;
  color: #34d399 !important;
  flex-shrink: 0 !important;
  margin-right: 12px !important;
  margin-left: 2px !important;
  position: static !important;
  pointer-events: none !important;
}

.field-input-box input {
  flex: 1 !important;
  width: 100% !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  font-family: inherit !important;
  padding: 13px 4px 13px 0 !important;
  caret-color: #34d399 !important;
}

.field-input-box input::placeholder {
  color: #52637a !important;
  font-size: 13.5px !important;
}

.btn-toggle-eye {
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  padding: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #94a3b8 !important;
}

.btn-toggle-eye:hover, .btn-toggle-eye:active {
  color: #34d399 !important;
}


/* ==========================================================================
   MARCO MODERNO Y LUXURY DEL LOGO OFICIAL (IDÉNTICO AL LOGIN)
   ========================================================================== */
.brand-logo-box {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: #0e1e19;
  border: 2px solid rgba(103, 124, 93, 0.45);
  box-shadow: 0 0 18px rgba(103, 124, 93, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  overflow: hidden;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-logo-box:hover {
  border-color: #34d399;
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.5);
  transform: scale(1.05);
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: none;
  box-shadow: none;
  border-radius: 8px;
}

.welcome-logo-box {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: #0e1e19;
  border: 2px solid rgba(103, 124, 93, 0.45);
  box-shadow: 0 0 28px rgba(103, 124, 93, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  margin: 0 auto 14px auto;
  overflow: hidden;
  transition: all 0.3s ease;
}

.welcome-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}


/* ==========================================================================
   MODAL PERFIL DE ASESOR Y CERRAR SESIÓN (DARK LUXURY)
   ========================================================================== */
.user-menu-modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 10, 8, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.user-menu-card {
  background: #081611;
  border: 1.5px solid rgba(103, 124, 93, 0.4);
  border-radius: 20px;
  width: 100%;
  max-width: 360px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(103, 124, 93, 0.15);
  transform: translateY(20px) scale(0.96);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.user-menu-modal.active .user-menu-card {
  transform: translateY(0) scale(1);
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
}

.user-menu-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #677c5d, #065f46);
  color: #ffffff;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(103, 124, 93, 0.4);
  flex-shrink: 0;
}

.user-menu-meta {
  flex: 1;
  min-width: 0;
}

.user-menu-meta h3 {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-badge {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #34d399;
  background: rgba(103, 124, 93, 0.12);
  border: 1px solid rgba(103, 124, 93, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
}

.btn-close-menu {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-close-menu:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.user-menu-body {
  background: rgba(6, 17, 14, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px 14px;
}

.session-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}

.pulse-green-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.user-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-menu-logout {
  width: 100%;
  background: rgba(239, 68, 68, 0.12);
  border: 1.5px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-menu-logout:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.btn-menu-cancel {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-menu-cancel:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}


/* ==========================================================================
   DISEÑO OFICIAL ESTILO WHATSAPP (DARK LUXURY & TIPOGRAFÍA OFICIAL)
   ========================================================================== */
.chat-container {
  background-color: #0b141a !important;
  background-image: radial-gradient(rgba(18, 140, 126, 0.04) 1px, transparent 0) !important;
  background-size: 24px 24px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  width: 100%;
}

.wsp-message-row {
  display: flex;
  width: 100%;
  margin-bottom: 3px;
}

.wsp-row-user {
  justify-content: flex-end;
}

.wsp-row-bot {
  justify-content: flex-start;
}

.wsp-bubble {
  position: relative;
  max-width: 86%;
  padding: 8px 12px 6px 12px;
  font-size: 14.5px;
  line-height: 1.45;
  letter-spacing: 0.15px;
  word-break: break-word;
  box-shadow: 0 1px 1px rgba(11, 20, 26, 0.25);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Burbuja Usuario (Derecha - Verde WhatsApp) */
.wsp-bubble-user {
  background-color: #005c4b !important;
  color: #e9edef !important;
  border-radius: 10px 10px 2px 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Burbuja Bot / Copiloto (Izquierda - Gris Oscuro WhatsApp) */
.wsp-bubble-bot {
  background-color: #202c33 !important;
  color: #e9edef !important;
  border-radius: 10px 10px 10px 2px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.wsp-bubble-text {
  font-size: 14.2px;
  color: #e9edef;
  line-height: 1.45;
}

.wsp-bubble-text p {
  margin: 0 0 6px 0;
}

.wsp-bubble-text p:last-child {
  margin-bottom: 0;
}

.wsp-bubble-text strong {
  color: #ffffff;
  font-weight: 700;
}

.wsp-bubble-text ul, .wsp-bubble-text ol {
  margin: 4px 0 6px 18px;
  padding: 0;
}

.wsp-bubble-text li {
  margin-bottom: 4px;
}

/* Metadatos (Hora, Botón Audio y Doble Check) */
.wsp-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 3px;
  font-size: 11px;
  color: #8696a0;
  user-select: none;
}

.wsp-bubble-time {
  font-size: 11px;
  color: #8696a0;
}

.wsp-double-check {
  color: #53bdeb;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: -1.5px;
  margin-left: 2px;
}

.wsp-btn-tts {
  background: transparent;
  border: none;
  color: #677c5d;
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  margin-right: 4px;
}

.wsp-btn-tts:hover {
  color: #25d366;
  transform: scale(1.1);
}

/* Tarjeta Lead Guardado */
.wsp-lead-card {
  background: rgba(0, 92, 75, 0.3);
  border: 1px solid rgba(103, 124, 93, 0.4);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0 4px 0;
}

.wsp-lead-header {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #34d399;
  font-size: 12.5px;
  margin-bottom: 6px;
}

.wsp-lead-body {
  font-size: 12px;
  color: #e9edef;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Typing Dots Estilo WhatsApp */
.wsp-typing-bubble {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
}

.wsp-typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}

.wsp-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #8696a0;
  animation: wsp-dot 1.4s infinite ease-in-out both;
}

.wsp-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.wsp-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes wsp-dot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.wsp-typing-text {
  font-size: 12px;
  color: #8696a0;
  font-style: italic;
}

/* Audio Player Bubble */
.wsp-audio-bubble {
  padding: 8px 10px;
}

.wsp-audio-player {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wsp-audio-duration {
  font-size: 11px;
  color: #8696a0;
}


/* Barra de Controles Duales (Voz y Micrófono) */
.audio-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  background: rgba(11, 20, 26, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}

.control-subgroup {
  display: flex;
  align-items: center;
  gap: 6px;
}

.control-subgroup .mode-label {
  font-size: 10px;
  font-weight: 700;
  color: #8696a0;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.control-subgroup .mode-segmented-control {
  background: #111b21;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 2px;
  display: flex;
  gap: 2px;
}

.control-subgroup .seg-btn {
  background: transparent;
  border: none;
  color: #8696a0;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.control-subgroup .seg-btn:hover {
  color: #e9edef;
  background: rgba(255, 255, 255, 0.05);
}

.control-subgroup .seg-btn.active {
  background: #005c4b;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}


/* ==========================================================================
   WHATSAPP DARK THEME & LAYOUT OVERRIDES (PRIORIDAD ALTA)
   ========================================================================== */
#chat-container, .chat-container {
  background-color: #0b141a !important;
  background-image: radial-gradient(rgba(18, 140, 126, 0.05) 1px, transparent 0) !important;
  background-size: 26px 26px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  padding: 12px 10px 90px 10px !important;
}

#messages-list, .messages-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 720px !important;
  margin: 0 auto !important;
}

.wsp-message-row {
  display: flex !important;
  width: 100% !important;
  margin-bottom: 4px !important;
}

.wsp-row-user {
  justify-content: flex-end !important;
}

.wsp-row-bot {
  justify-content: flex-start !important;
}

.wsp-bubble {
  position: relative !important;
  max-width: 85% !important;
  padding: 8px 12px 6px 12px !important;
  font-size: 14.5px !important;
  line-height: 1.45 !important;
  word-break: break-word !important;
  box-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.35) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

/* Usuario a la DERECHA en Verde WhatsApp */
.wsp-bubble-user {
  background: #005c4b !important;
  color: #e9edef !important;
  border-radius: 12px 12px 2px 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
}

/* Bot a la IZQUIERDA en Gris Oscuro WhatsApp */
.wsp-bubble-bot {
  background: #202c33 !important;
  color: #e9edef !important;
  border-radius: 12px 12px 12px 2px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.wsp-bubble-text {
  font-size: 14.2px !important;
  color: #e9edef !important;
  line-height: 1.45 !important;
}

.wsp-bubble-text p {
  margin: 0 0 6px 0 !important;
}

.wsp-bubble-text p:last-child {
  margin-bottom: 0 !important;
}

.wsp-bubble-text strong {
  color: #ffffff !important;
  font-weight: 700 !important;
}

.wsp-bubble-meta {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 5px !important;
  margin-top: 4px !important;
  font-size: 11px !important;
  color: #8696a0 !important;
  user-select: none !important;
}

.wsp-bubble-time {
  font-size: 11px !important;
  color: #8696a0 !important;
}

.wsp-double-check {
  color: #53bdeb !important;
  font-size: 12px !important;
  font-weight: bold !important;
  letter-spacing: -1.5px !important;
  margin-left: 2px !important;
}

.wsp-btn-tts {
  background: transparent !important;
  border: none !important;
  color: #677c5d !important;
  cursor: pointer !important;
  padding: 2px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
  margin-right: 4px !important;
}

.wsp-btn-tts:hover {
  color: #25d366 !important;
  transform: scale(1.1) !important;
}

.wsp-lead-card {
  background: rgba(0, 92, 75, 0.35) !important;
  border: 1px solid rgba(103, 124, 93, 0.4) !important;
  border-radius: 8px !important;
  padding: 10px 12px !important;
  margin: 8px 0 4px 0 !important;
}

.wsp-typing-bubble {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 14px !important;
}

.wsp-typing-dots {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.wsp-typing-dots span {
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  background-color: #8696a0 !important;
  animation: wsp-dot 1.4s infinite ease-in-out both !important;
}

.wsp-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.wsp-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes wsp-dot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.wsp-typing-text {
  font-size: 12px !important;
  color: #8696a0 !important;
  font-style: italic !important;
}

/* ==========================================================================
   PRECARGA RÁPIDA DE PROPIEDAD (pantalla completa, mobile-first)
   ========================================================================== */
.precarga-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-main);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.precarga-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px calc(14px + env(safe-area-inset-top, 0px));
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  background: var(--bg-surface);
  border-bottom: 1px solid var(--accent-border);
  flex-shrink: 0;
}

.precarga-back-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--accent-border);
  background: var(--bg-card);
  color: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.precarga-header h2 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 2px;
}

.precarga-header span {
  font-size: 11.5px;
  color: var(--text-muted);
}

.precarga-form {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px calc(32px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.precarga-section {
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.precarga-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--accent-light);
  margin: 0;
}

.precarga-section h3 svg,
.precarga-section h3 i {
  width: 16px;
  height: 16px;
}

.precarga-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: -6px;
}

.precarga-row {
  display: flex;
  gap: 10px;
}

.precarga-field {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.precarga-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.precarga-field input,
.precarga-field select,
.precarga-field textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 15px;
  padding: 12px 14px;
}

.precarga-field input:focus,
.precarga-field select:focus,
.precarga-field textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.precarga-field textarea {
  resize: vertical;
  font-size: 14px;
  line-height: 1.5;
}

.precarga-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
}

.precarga-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  font-size: 12.5px;
  color: var(--text-emerald);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.precarga-check-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--accent-border);
  background: rgba(255,255,255,0.03);
  accent-color: var(--accent-primary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.precarga-check-item input[type="checkbox"]:checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'><path d='M3 8.5L6.2 12 13 4' stroke='%2306110e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}

.precarga-footnote {
  font-size: 11.5px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.5;
  padding: 0 4px;
}

.precarga-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-bright));
  color: #04120f;
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
}

.precarga-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.precarga-submit-btn svg,
.precarga-submit-btn i {
  width: 18px;
  height: 18px;
}

.precarga-cancel-btn {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  border: none;
  background: none;
  color: var(--text-dim);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Botón "Volver" del header -- con texto visible al lado del ícono, para que siempre haya una
   forma legible de salir aunque el ícono de lucide no llegue a hidratar a tiempo. */
.precarga-back-btn {
  width: auto;
  min-width: 38px;
  height: 38px;
  padding: 0 12px 0 10px;
  gap: 6px;
}

.precarga-back-btn-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-light);
  white-space: nowrap;
}

.precarga-checkbox-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-emerald);
  cursor: pointer;
}

.precarga-checkbox-inline input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.precarga-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.precarga-section-header h3 {
  margin: 0;
}

.precarga-add-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--accent-border);
  background: var(--accent-subtle);
  color: var(--accent-light);
  font-family: var(--font-family);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.precarga-add-btn svg,
.precarga-add-btn i {
  width: 13px;
  height: 13px;
}

.precarga-repeater-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--accent-border);
}

.precarga-repeater-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.precarga-repeater-row-header span {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.precarga-remove-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
  font-family: var(--font-family);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

/* Botón de precarga en el header -- ícono de "carga" con un puntito animado para que se note que
   ahí es donde arranca el flujo, ya que entre el resto de íconos del header pasaba desapercibido. */
.btn-precarga-header {
  position: relative;
}

.btn-precarga-header-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.6);
  animation: precargaDotPulse 2s infinite;
}

@keyframes precargaDotPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@media (max-width: 420px) {
  .precarga-checks {
    grid-template-columns: 1fr;
  }
}

/* Evita que un deslizamiento rapido hacia abajo dispare el "tirar para actualizar" del navegador
   (recargaba la pagina y borraba el formulario de Precarga a medio cargar). */
html, body {
  overscroll-behavior-y: contain;
}
.precarga-overlay,
.precarga-form {
  overscroll-behavior: contain;
}

/* Selector de voz Hombre/Mujer: oculto mientras la voz este fija en la femenina (la gratuita).
   Para volver a mostrarlo, sacar la clase voz-selector-oculto del bloque en asesor.html. */
.voz-selector-oculto {
  display: none !important;
}

/* ==========================================================================
   SELECTOR DE PRECARGAS SIN TERMINAR
   ==========================================================================
   Aparece al tocar "Cargar Propiedad Nueva" si el asesor dejo alguna a medio cargar: puede seguir
   una o empezar de cero, en vez de arrancar siempre una nueva sin darse cuenta. */
.precarga-selector {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.precarga-selector-card {
  background: var(--bg-surface, #111b21);
  border: 1px solid var(--accent-border, #2a3942);
  border-radius: 18px 18px 0 0;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  overflow-y: auto;
}
.precarga-selector-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main, #e9edef);
}
.precarga-selector-card p {
  margin: 0 0 14px;
  font-size: 12.5px;
  color: var(--text-muted, #8696a0);
}
.precarga-selector-lista {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.precarga-selector-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--accent-border, #2a3942);
  background: var(--bg-card, #1b2733);
  cursor: pointer;
}
.precarga-selector-item:active { transform: scale(0.99); }
.precarga-selector-titulo {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main, #e9edef);
}
.precarga-selector-sub {
  font-size: 11.5px;
  color: var(--text-muted, #8696a0);
}
.precarga-selector-acciones {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.precarga-selector-nueva {
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: var(--accent, #677c5d);
  color: #fff;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
}
.precarga-selector-cerrar {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--accent-border, #2a3942);
  background: transparent;
  color: var(--text-muted, #8696a0);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
