/* ===== DARK MODE VARIABLES ===== */
:root {
  --bg-primary: #070B14;
  --bg-secondary: #111827;
  --bg-card: #111827;
  --bg-input: rgba(255, 255, 255, 0.08);
  --bg-hover: rgba(255, 255, 255, 0.1);

  --text-primary: #ffffff;
  --text-secondary: #E5E7EB;
  --text-muted: #9CA3AF;

  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.2);

  --accent: #2563EB;
  --accent-hover: #3B82F6;
  --accent-glow: rgba(37, 99, 235, 0.15);

  --error: #ef4444;
  --success: #22c55e;
  --whatsapp: #25D366;

  --border-radius: 12px;
  --border-radius-sm: 8px;

  --message-bot-bg: #111827;
  --message-user-bg: #2563EB;
  --message-border: rgba(255, 255, 255, 0.1);
  --message-user-border: rgba(37, 99, 235, 0.3);

  --font-primary: 'IBM Plex Sans', 'Inter', system-ui, sans-serif;
  --font-secondary: 'IBM Plex Sans', 'Inter', system-ui, sans-serif;

  --scrollbar-track: #1e293b;
  --scrollbar-thumb: #475569;
  --scrollbar-thumb-hover: #64748b;
}

/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  min-height: 100dvh;
}

body {
  font-family: var(--font-primary);
  font-weight: 300;
  background: #070B14;
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100dvh;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ===== APP BODY: Centrado absoluto exacto ===== */
.app-body {
  min-height: 100dvh;
  height: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.app-body::before,
.app-body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.12;
  z-index: 0;
  pointer-events: none;
}

.app-body::before {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, #2563EB 0%, transparent 70%);
  top: -250px;
  left: -250px;
}

.app-body::after {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #143459 0%, transparent 70%);
  bottom: -200px;
  right: -200px;
}

/* ===== APP CONTAINER ===== */
.app-container {
  width: 100%;
  min-height: 100dvh;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* ===== WELCOME SCREEN (Pantalla de bienvenida centrada) ===== */
.welcome-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-bottom: 100px;
  animation: fadeIn 0.5s ease-out;
}

.welcome-logo {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.welcome-logo-svg {
  width: auto;
  height: 36px;
}

.welcome-badge {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--accent-hover);
  background: rgba(37, 99, 235, 0.15);
  padding: 4px 12px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.welcome-subtitle {
  font-size: clamp(0.875rem, 3vw, 1rem);
  font-weight: 300;
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 320px;
}

.welcome-nav {
  display: none;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ===== ONBOARDING CONTAINER ===== */
.onboarding-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 560px;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .onboarding-container {
    max-width: 900px;
  }
}

.onboarding-message {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  padding: 16px 20px;
  margin-bottom: 20px;
  width: 100%;
  max-width: 85%;
  text-align: left;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-primary);
  animation: messageIn 0.4s ease-out;
  min-height: 1.6em;
}

.onboarding-message.typing::after {
  content: '▊';
  animation: blink 0.7s infinite;
  color: var(--accent);
  margin-left: 2px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.onboarding-replies {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 500px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.onboarding-replies.visible {
  opacity: 1;
}

.onboarding-replies.visible .onboarding-btn-primary {
  animation: slideUp 0.4s ease 0.1s both;
}

.onboarding-replies.visible .onboarding-divider {
  animation: slideUp 0.4s ease 0.15s both;
}

.onboarding-replies.visible .onboarding-secondary-wrapper {
  animation: slideUp 0.4s ease 0.2s both;
}

@media (min-width: 768px) {
  .onboarding-replies {
    max-width: 520px;
  }
}

.onboarding-secondary-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 500px) {
  .onboarding-secondary-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}

.onboarding-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.onboarding-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.onboarding-btn:hover svg {
  transform: scale(1.1);
}

.onboarding-btn-primary {
  background: var(--accent);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.onboarding-btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 8px 20px rgba(37, 99, 235, 0.4),
    0 0 0 3px rgba(37, 99, 235, 0.15);
}

.onboarding-btn-primary:active {
  transform: scale(0.98);
}

.onboarding-btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.onboarding-btn-secondary:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.2);
}

.onboarding-btn-secondary:active {
  transform: scale(0.98);
}

.onboarding-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 2px 0;
}

.onboarding-divider::before,
.onboarding-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.onboarding-divider span {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.onboarding-tooltip-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: auto;
}

.onboarding-tooltip-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  cursor: help;
  flex-shrink: 0;
}

.onboarding-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 400;
  padding: 8px 12px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 10;
  pointer-events: none;
}

.onboarding-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e293b;
}

.onboarding-tooltip-wrapper:hover .onboarding-tooltip {
  opacity: 1;
  visibility: visible;
}

.onboarding-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  padding: 10px 14px;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 8px;
  border-left: 4px solid var(--accent);
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.3s ease;
}

.onboarding-hint.visible {
  opacity: 1;
  transform: translateY(0);
}

.onboarding-hint.hidden {
  display: none;
}

.onboarding-hint .hint-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--accent);
}

/* ===== VALUE CARDS ===== */
.onboarding-value-cards {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
  width: 100%;
  max-width: 700px;
}

@media (min-width: 768px) {
  .onboarding-value-cards {
    display: grid;
  }
}

.value-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  transition: all 0.2s ease;
}

.value-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.value-card-icon {
  width: 32px;
  height: 32px;
  color: var(--accent);
  margin-bottom: 12px;
}

.value-card h4 {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.value-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.welcome-screen.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

/* ===== CONTENEDOR CENTRAL: Chat ===== */
.chat-content {
  width: 100%;
  max-width: 56rem;
  min-height: 100dvh;
  height: auto;
  display: flex;
  flex-direction: column;
  padding: 16px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== NAVIGATION PILLS ===== */
.nav-pills {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 0 8px 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-pills::-webkit-scrollbar {
  display: none;
}

.nav-pill {
  padding: 10px 16px;
  min-height: 44px;
  flex: 0 0 auto;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 400;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.nav-pill::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.nav-pill:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

.nav-pill:hover::before {
  opacity: 0.05;
}

.nav-pill:active {
  transform: scale(0.96);
}

.nav-pill.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
}

.nav-pill.active::before {
  opacity: 0;
}

/* ===== MESSAGES AREA ===== */
.messages-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 8px;
  padding-bottom: 16px;
}

.messages-area::-webkit-scrollbar {
  width: 4px;
}

.messages-area::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 2px;
}

.messages-area::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 2px;
}

.messages-area::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

/* ===== MESSAGE ANIMATIONS ===== */
.message {
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.7;
  animation: messageIn 0.3s ease-out;
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.message.user {
  align-self: flex-end;
  background: var(--message-user-bg);
  color: var(--text-primary);
  border: 1px solid var(--message-user-border);
  border-bottom-right-radius: 4px;
  max-width: 85%;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.message.bot {
  align-self: flex-start;
  background: var(--message-bot-bg);
  border: 1px solid var(--message-border);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  max-width: 92%;
}

.message.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
  font-size: 0.875rem;
}

.message-content {
  line-height: 1.7;
  color: var(--text-secondary);
}

.message-content p {
  margin-bottom: 12px;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content strong {
  font-weight: 600;
  color: #ffffff;
}

.message-content ul,
.message-content ol {
  margin: 8px 0;
  padding-left: 24px;
}

.message-content li {
  margin-bottom: 4px;
}

.message-content ul li {
  list-style-type: disc;
}

.message-content ol li {
  list-style-type: decimal;
}

.message-content a.message-link {
  color: var(--accent-hover);
  text-decoration: underline;
  word-break: break-all;
}

/* ===== TYPING INDICATOR ===== */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  align-self: flex-start;
  margin-bottom: 8px;
  animation: messageIn 0.3s ease-out;
}

.typing-indicator.hidden {
  display: none;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background-color: var(--text-muted);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.typing-text {
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--text-muted);
  font-style: italic;
  margin-left: 4px;
}

/* ===== INPUT AREA ===== */
.input-area {
  width: 100%;
  flex-shrink: 0;
  padding-top: 24px;
  margin-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.char-counter {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-align: left;
  padding-left: 4px;
  transition: color 0.2s ease;
}

.char-counter.warning {
  color: #F59E0B;
}

.char-counter.error {
  color: #EF4444;
}

.input-container {
  display: flex;
  align-items: flex-end;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 8px 12px;
  gap: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-container:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-container.limit-reached {
  border-color: #EF4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

.message-input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 16px;
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  color: var(--text-primary);
  outline: none;
  padding: 10px 12px;
  min-height: 48px;
  max-height: 120px;
  resize: none;
  line-height: 1.5;
  -webkit-appearance: none;
}

.message-input::placeholder {
  color: var(--text-muted);
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== SEND BUTTON ===== */
.send-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  background: var(--accent);
  color: var(--text-primary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.send-button.visible {
  display: flex;
}

.send-button:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}

.send-button:active {
  transform: scale(0.95);
}

.send-button.disabled {
  background: var(--bg-hover);
  cursor: not-allowed;
  opacity: 0.5;
}

.send-button.disabled:hover {
  background: var(--bg-hover);
  transform: none;
}

/* ===== QUICK ACTIONS (Submenús) ===== */
.quick-actions {
  padding-top: 16px;
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(37, 99, 235, 0.4) transparent;
}

.quick-actions::-webkit-scrollbar {
  width: 4px;
}

.quick-actions::-webkit-scrollbar-track {
  background: transparent;
}

.quick-actions::-webkit-scrollbar-thumb {
  background: rgba(37, 99, 235, 0.4);
  border-radius: 4px;
}

.quick-actions::-webkit-scrollbar-thumb:hover {
  background: rgba(37, 99, 235, 0.6);
}

.quick-actions.hidden {
  display: none;
}

/* ===== SUB MENU ===== */
.sub-menu {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
  animation: slideDown 0.3s ease-out;
}

.sub-menu.hidden {
  display: none;
}

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

.sub-menu-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sub-menu-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.segment-header {
  padding: 10px 14px;
  background: #1e3a5f;
  color: #ffffff;
  font-size: 0.9375rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 6px;
  margin-top: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.segment-header:first-child {
  margin-top: 0;
}

.menu-divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 16px 0;
}

.sub-btn {
  padding: 12px 16px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 400;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.sub-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.back-btn {
  padding: 12px 16px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 400;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  width: 100%;
  min-height: 44px;
}

.back-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-secondary);
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
  padding: 32px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  animation: scaleIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-icon {
  color: var(--accent);
  margin-bottom: 16px;
}

.modal-content h2 {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.modal-content p {
  font-size: 0.9375rem;
  font-weight: 300;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-btn {
  padding: 14px 24px;
  min-height: 48px;
  border-radius: var(--border-radius-sm);
  font-size: 1rem;
  font-weight: 400;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  -webkit-tap-highlight-color: transparent;
}

.modal-btn.primary {
  background: var(--accent);
  color: var(--text-primary);
}

.modal-btn.primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.modal-btn.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.modal-btn.secondary:hover {
  background: rgba(37, 99, 235, 0.1);
}

/* ===== REGISTRATION MODAL ===== */
.registration-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
  overflow-y: auto;
  padding: 20px;
}

.registration-modal-overlay.hidden {
  display: none;
}

.registration-modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
  padding: 24px;
  max-width: 720px;
  width: 100%;
  animation: scaleIn 0.3s ease-out;
  max-height: 90vh;
  overflow-y: auto;
}

.registration-modal-content h2 {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  text-align: center;
}

.registration-modal-content > p {
  font-size: 0.9375rem;
  font-weight: 300;
  color: var(--text-secondary);
  margin-bottom: 24px;
  text-align: center;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.form-input,
.form-select {
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  font-size: 16px;
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 48px;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input.input-error {
  border-color: var(--error);
}

.form-input.input-valid {
  border-color: var(--success);
}

.username-error-msg,
.field-error-msg {
  font-size: 0.75rem;
  color: var(--error);
  margin-top: 2px;
  min-height: 1rem;
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-select option {
  color: #ffffff;
  background: #111827;
  padding: 8px 12px;
}

.form-buttons {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.form-buttons .modal-btn {
  flex: 1;
  padding: 14px 24px;
}

.tooltip-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  vertical-align: middle;
}

.tooltip-icon {
  color: var(--accent);
  cursor: help;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.tooltip-icon:hover {
  color: var(--accent-hover);
}

.tooltip-text {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-secondary);
  width: 220px;
  z-index: 1000;
  text-align: left;
  line-height: 1.4;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.tooltip-text::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border);
}

.tooltip-text::after {
  content: '';
  position: absolute;
  top: calc(100% - 1px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--bg-secondary);
}

  .tooltip-wrapper:hover .tooltip-text {
    display: block;
    animation: tooltipFadeIn 0.2s ease-out;
  }

  @keyframes tooltipFadeIn {
    from {
      opacity: 0;
      transform: translateX(-50%) translateY(4px);
    }
    to {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }
  }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  html, body {
    height: 100%;
    height: 100dvh;
  }

  body {
    height: 100dvh;
  }

  .chat-content {
    padding: 12px 16px;
    min-height: 100dvh;
    height: auto;
    overflow-y: auto;
  }

  .messages-area {
    padding: 0 4px 16px 0;
  }

  .welcome-screen {
    padding-bottom: 80px;
  }

  .nav-pills {
    gap: 8px;
    padding: 8px 0;
    justify-content: flex-start;
  }

  .nav-pill {
    padding: 10px 14px;
    font-size: 0.8125rem;
    min-height: 44px;
    flex: 0 0 auto;
    text-align: center;
  }

  .message {
    font-size: 0.875rem;
    max-width: 90%;
    padding: 12px 14px;
  }

  .message-content {
    font-size: 0.875rem;
  }

  .sub-menu-title {
    font-size: 0.8125rem;
  }

  .segment-header {
    font-size: 0.8125rem;
    padding: 8px 12px;
  }

  .sub-menu {
    padding: 12px;
  }

  .sub-btn {
    font-size: 0.8125rem;
    min-height: 44px;
    padding: 10px 14px;
  }

  .back-btn {
    font-size: 0.8125rem;
    min-height: 44px;
    padding: 10px 14px;
  }

  .modal-content h2 {
    font-size: 1.125rem;
  }

  .modal-content p {
    font-size: 0.875rem;
  }

  .modal-content {
    padding: 20px;
    margin: 16px;
  }

  .registration-modal-content {
    padding: 16px 12px;
    margin: 4px;
  }

  .registration-form {
    gap: 12px;
  }

  .form-label {
    font-size: 0.75rem;
  }

  .form-input,
  .form-select {
    font-size: 16px;
    min-height: 48px;
    padding: 10px 12px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .form-buttons {
    gap: 8px;
  }

  .form-buttons .modal-btn {
    padding: 12px 16px;
  }

  #registration-form .form-label {
    font-size: 0.6875rem;
  }

  #registration-form .form-select {
    font-size: 0.8125rem;
    padding: 8px 10px;
  }

  #registration-form .form-select option {
    font-size: 0.75rem;
    padding: 4px 8px;
    color: #ffffff;
    background: #111827;
  }

  #registration-form #reg-sap-usuario {
    font-size: 0.8125rem;
  }

  .input-container {
    padding: 6px 10px;
  }

  .message-input {
    font-size: 16px;
    padding: 8px 10px;
    min-height: 48px;
  }

  .send-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
}

/* ===== MICROINTERACTIONS - HOVER & ACTIVE STATES ===== */
.nav-pill {
  transition: all 0.2s ease-in-out;
}

.nav-pill:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--text-primary);
}

.nav-pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav-pill:active {
  transform: scale(0.98);
}

.sub-btn {
  transition: all 0.2s ease-in-out;
}

.sub-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

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

.back-btn {
  transition: all 0.2s ease-in-out;
}

.back-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

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

.modal-btn {
  transition: all 0.2s ease-in-out;
}

.modal-btn.primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.modal-btn.secondary:hover {
  background: rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

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

.send-button {
  transition: all 0.2s ease-in-out;
}

.send-button:active {
  transform: scale(0.95);
}

/* ===== SEGMENT ICONS ===== */
.segment-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.segment-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ===== SPINNER ===== */
.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-loading {
  pointer-events: none;
  opacity: 0.7;
}

/* ===== SKELETON SCREENS ===== */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-content {
  padding: 4px 0;
}

.skeleton-line {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 4px;
}

.skeleton-line:last-child {
  margin-bottom: 0;
}

.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-line.full { width: 100%; }

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  animation: toast-in 0.3s ease-out;
  max-width: 400px;
  min-width: 280px;
  pointer-events: auto;
}

.toast.toast-success {
  border-color: var(--success);
  border-left: 4px solid var(--success);
}

.toast.toast-error {
  border-color: var(--error);
  border-left: 4px solid var(--error);
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--error); }

.toast-message {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 400;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.toast-close:hover {
  color: var(--text-primary);
}

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

.toast.toast-out {
  animation: toast-out 0.3s ease-in forwards;
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* ===== WHATSAPP STYLES ===== */
.whatsapp-link {
  color: #25D366 !important;
  font-weight: 500;
}

.whatsapp-link:hover {
  color: #25D366;
  text-decoration: underline;
}

.modal-btn.whatsapp {
  background: #25D366;
  color: #ffffff;
  border: 1px solid #25D366;
}

.modal-btn.whatsapp:hover {
  background: #20BD5A;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.modal-btn.whatsapp:active {
  transform: scale(0.98);
}

/* ===== EXPAND ICON (Circular White Outline) ===== */
.expand-icon {
  width: 24px;
  height: 24px;
  border: 1.5px solid #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #ffffff;
  flex-shrink: 0;
}

.expand-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

@media (max-width: 380px) {
  .nav-pill {
    padding: 8px 12px;
    font-size: 0.75rem;
  }

  .welcome-title {
    font-size: 1.25rem;
  }

  .welcome-badge {
    font-size: 0.625rem;
    padding: 3px 8px;
  }

  .modal-btn {
    padding: 12px 16px;
    min-height: 44px;
    font-size: 0.875rem;
  }
}

/* ===== ONBOARDING HINT MODAL ===== */
.onboarding-hint-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(4px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

.onboarding-hint-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  animation: messageIn 0.4s ease-out;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.onboarding-hint-icon {
  width: 56px;
  height: 56px;
  background: rgba(37, 99, 235, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.onboarding-hint-icon svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.onboarding-hint-modal h3 {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.onboarding-hint-modal p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.onboarding-hint-btn {
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 12px 32px;
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
}

.onboarding-hint-btn:hover {
  background: var(--accent-hover);
}

/* ===== REGISTRATION HINT MODAL ===== */
.registration-hint-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(4px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

.registration-hint-overlay.hidden {
  display: none;
}

.registration-hint-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 28px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  animation: messageIn 0.4s ease-out;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.registration-hint-icon {
  width: 56px;
  height: 56px;
  background: rgba(37, 99, 235, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.registration-hint-icon svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.registration-hint-modal h3 {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.registration-hint-content {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  text-align: left;
}

.hint-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.hint-step:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.hint-step:first-child {
  padding-top: 0;
}

.step-number {
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.step-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-top: 2px;
}

.step-text strong {
  color: var(--text-primary);
  font-weight: 500;
}

.registration-hint-roles {
  margin-bottom: 20px;
}

.roles-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.roles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  text-align: left;
}

.role-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.role-tag {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(37, 99, 235, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.role-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.registration-hint-btn {
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 12px 32px;
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.registration-hint-btn:hover {
  background: var(--accent-hover);
}

.input-focused {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.4);
  border-color: var(--accent) !important;
}

/* ===== FLOATING ICONS BACKGROUND ===== */
.floating-icons-bg {
  position: fixed;
  inset: 0;
  z-index: -20;
  pointer-events: none;
  overflow: hidden;
}

.floating-icon {
  position: absolute;
  color: #ffffff;
  stroke-width: 1;
  fill: none;
  pointer-events: none;
}

.fi-1 { top: 88%; left: 5%; width: 28px; animation: float-a 30s linear infinite; animation-delay: -2s; }
.fi-2 { top: 75%; left: 18%; width: 24px; animation: float-b 35s linear infinite; animation-delay: -8s; }
.fi-3 { top: 92%; left: 35%; width: 32px; animation: float-a 28s linear infinite; animation-delay: -14s; }
.fi-4 { top: 80%; left: 55%; width: 26px; animation: float-b 32s linear infinite; animation-delay: -5s; }
.fi-5 { top: 70%; left: 75%; width: 22px; animation: float-a 36s linear infinite; animation-delay: -18s; }
.fi-6 { top: 95%; left: 88%; width: 30px; animation: float-b 26s linear infinite; animation-delay: -10s; }
.fi-7 { top: 65%; left: 12%; width: 24px; animation: float-a 31s linear infinite; animation-delay: -6s; }
.fi-8 { top: 85%; left: 45%; width: 28px; animation: float-b 34s linear infinite; animation-delay: -16s; }
.fi-9 { top: 78%; left: 68%; width: 22px; animation: float-a 29s linear infinite; animation-delay: -12s; }
.fi-10 { top: 90%; left: 82%; width: 26px; animation: float-b 33s linear infinite; animation-delay: -20s; }
.fi-11 { top: 72%; left: 30%; width: 30px; animation: float-a 27s linear infinite; animation-delay: -4s; }
.fi-12 { top: 68%; left: 92%; width: 24px; animation: float-b 37s linear infinite; animation-delay: -22s; }
.fi-13 { top: 83%; left: 8%; width: 28px; animation: float-a 32s linear infinite; animation-delay: -9s; }
.fi-14 { top: 60%; left: 50%; width: 22px; animation: float-b 30s linear infinite; animation-delay: -13s; }

@keyframes float-a {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0.2; }
  50% { transform: translate(-60px, -50vh) rotate(4deg); opacity: 0.25; }
  100% { transform: translate(-120px, -100vh) rotate(0deg); opacity: 0.2; }
}

@keyframes float-b {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0.2; }
  50% { transform: translate(60px, -55vh) rotate(-4deg); opacity: 0.25; }
  100% { transform: translate(120px, -105vh) rotate(0deg); opacity: 0.2; }
}

/* ===== MEDIA MODAL ===== */
.media-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.media-modal.visible {
  opacity: 1;
  visibility: visible;
}

.media-modal.hidden {
  display: none;
}

.media-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 2001;
}

.media-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.media-modal-close:active {
  transform: scale(0.95);
}

.media-modal-image {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: scale(0.85);
}

.media-modal.visible .media-modal-image {
  animation: modalImageIn 0.9s ease-out forwards;
}

.media-modal.closing .media-modal-image {
  animation: modalImageOut 0.4s ease-in forwards;
}

@keyframes modalImageIn {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes modalImageOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.85);
  }
}
