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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0a1628 0%, #1a2332 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

/* ========== MAIN CONTENT ========== */
.main-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  text-align: center;
  max-width: 400px;
  width: 100%;
}

/* ========== LOGO ========== */
.logo-container {
  margin: 0 auto 40px;
  text-align: center;
}

.logo-image {
  width: 350px;
  max-width: 90%;
  height: auto;
  filter: drop-shadow(0 10px 30px rgba(255, 193, 7, 0.3));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-12px);
  }
}

/* ========== SUBTITLE ========== */
.subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  margin-bottom: 25px;
  font-weight: 500;
}

/* ========== LEGAL NOTICE (BANNER +21) ========== */
.legal-notice {
  background: rgba(255, 193, 7, 0.12);
  padding: 8px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 3px solid #ffc107;
  text-align: center;
}

.legal-notice p {
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
}

.legal-notice strong {
  color: #ffc107;
  font-weight: 600;
}

/* ========== BUTTONS ========== */
.button-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-button {
  padding: 20px 40px;
  font-size: 20px;
  font-weight: 600;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.whatsapp-button {
  background: #25d366;
  color: white;
}

.whatsapp-button:hover {
  background: #20bd5a;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

.telegram-button {
  background: #0088cc;
  color: white;
}

.telegram-button:hover {
  background: #0077b3;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 136, 204, 0.4);
}

.button-icon {
  font-size: 28px;
}

/* ========== INFO TEXT ========== */
.info-text {
  color: white;
  margin-top: 30px;
  font-size: 14px;
  opacity: 0.8;
}

/* ========== LOADING OVERLAY ========== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.loading-overlay.show {
  display: flex;
}

.loading-content {
  text-align: center;
  color: white;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ========== FOOTER ========== */
.legal-footer {
  background: rgba(26, 35, 50, 0.95);
  border-top: 1px solid rgba(255, 193, 7, 0.2);
  padding: 25px 20px 20px;
  margin-top: 60px;
  backdrop-filter: blur(10px);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-bottom: 25px;
}

.footer-section h4 {
  color: #ffc107;
  font-size: 14px;
  margin-bottom: 12px;
  font-weight: 600;
}

.footer-section p,
.footer-section a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  line-height: 1.8;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-section a:hover {
  color: #ffc107;
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-disclaimer {
  background: rgba(255, 193, 7, 0.08);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 3px solid #ffc107;
}

.footer-disclaimer p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  line-height: 1.6;
  margin: 0;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  margin: 5px 0;
}

/* ========== CHAT WIDGET ========== */
#chat-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  transition: all 0.3s ease;
  animation: pulse-chat 2s infinite;
}

@keyframes pulse-chat {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
  }
}

#chat-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.8);
  animation: none;
}

#chat-button.hidden {
  display: none;
}

/* ========== CHAT CONTAINER ========== */
#chat-container {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 380px;
  height: 550px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  display: none;
  flex-direction: column;
  z-index: 9999;
  overflow: hidden;
  animation: slideUp 0.3s ease-out;
}

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

#chat-container.active {
  display: flex;
}

/* ========== CHAT HEADER ========== */
#chat-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#chat-header h3 {
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

#chat-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

#chat-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg);
}

/* ========== REGISTER FORM ========== */
#register-form {
  padding: 30px 25px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  justify-content: center;
  flex: 1;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

#register-form h4 {
  text-align: center;
  color: #333;
  margin-bottom: 5px;
  font-size: 22px;
}

#register-form p {
  text-align: center;
  color: #666;
  margin-bottom: 15px;
  font-size: 14px;
}

#register-form input {
  padding: 14px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 15px;
  transition: all 0.3s;
  background: white;
}

#register-form input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#register-form button {
  padding: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

#register-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

#register-form button:active {
  transform: translateY(0);
}

/* ========== MESSAGES AREA ========== */
#messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f5f5f5;
  display: none;
}

#messages-area.active {
  display: block;
}

#messages-area::-webkit-scrollbar {
  width: 6px;
}

#messages-area::-webkit-scrollbar-track {
  background: #f1f1f1;
}

#messages-area::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

#messages-area::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* ========== MESSAGES ========== */
.message {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease-out;
}

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

.message.user {
  align-items: flex-end;
}

.message.bot {
  align-items: flex-start;
}

.message-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 18px;
  word-wrap: break-word;
  line-height: 1.4;
}

.message.user .message-bubble {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.message.bot .message-bubble {
  background: white;
  color: #333;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.message-time {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
  padding: 0 4px;
}

.message-image {
  max-width: 75%;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s;
}

.message-image:hover {
  transform: scale(1.02);
}

/* ========== QUICK OPTIONS ========== */
.quick-options {
  padding: 8px 12px;
  background: #fafafa;
  border-top: 1px solid #e0e0e0;
  display: none;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.quick-options.active {
  display: flex;
}

.quick-option-btn {
  flex: 1;
  min-width: calc(33.333% - 4px);
  padding: 8px 10px;
  background: white;
  border: 1.5px solid #667eea;
  border-radius: 16px;
  color: #667eea;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  white-space: nowrap;
}

.quick-option-btn:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.quick-option-btn:active {
  transform: translateY(0);
}

/* ========== INPUT AREA ========== */
#input-area {
  padding: 15px;
  background: white;
  border-top: 1px solid #e0e0e0;
  display: none;
}

#input-area.active {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

#message-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 24px;
  font-size: 14px;
  resize: none;
  font-family: inherit;
  max-height: 100px;
  transition: border 0.3s;
}

#message-input:focus {
  outline: none;
  border-color: #667eea;
}

#send-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.2s;
  flex-shrink: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

#send-button:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========== CONNECTION STATUS ========== */
.connection-status {
  font-size: 12px;
  padding: 8px 15px;
  text-align: center;
  display: none;
}

.connection-status.show {
  display: block;
  animation: slideDown 0.3s ease-out;
}

.connection-status.success {
  background: #d4edda;
  color: #155724;
  border-bottom: 1px solid #c3e6cb;
}

.connection-status.error {
  background: #f8d7da;
  color: #721c24;
  border-bottom: 1px solid #f5c6cb;
}

.connection-status.warning {
  background: #fff3cd;
  color: #856404;
  border-bottom: 1px solid #ffeaa7;
}

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

/* ========== SYSTEM MESSAGE ========== */
.system-message {
  text-align: center;
  padding: 10px;
  color: #666;
  font-size: 13px;
  margin: 10px 0;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
}

/* ========== TYPING INDICATOR ========== */
.typing-indicator {
  display: none;
  padding: 10px 20px;
  align-items: center;
}

.typing-indicator.show {
  display: flex;
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
  padding: 12px 16px;
  background: white;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #999;
  animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .logo-image {
    width: 280px;
  }

  .subtitle {
    font-size: 14px;
  }

  .contact-button {
    padding: 18px 30px;
    font-size: 18px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  #chat-container {
    width: calc(100vw - 20px);
    height: calc(100vh - 100px);
    bottom: 10px;
    right: 10px;
    left: 10px;
    border-radius: 12px;
  }

  #chat-button {
    bottom: 15px;
    right: 15px;
    width: 56px;
    height: 56px;
  }

  .quick-option-btn {
    font-size: 11px;
    padding: 7px 8px;
  }
}

@media (max-width: 480px) {
  .logo-image {
    width: 240px;
  }

  .subtitle {
    font-size: 13px;
    margin-bottom: 20px;
  }

  .legal-notice {
    padding: 6px 12px;
    margin-bottom: 15px;
  }

  .legal-notice p {
    font-size: 11px;
  }

  .contact-button {
    padding: 16px 25px;
    font-size: 16px;
  }

  .button-icon {
    font-size: 24px;
  }
}