/* SmartLoads - Estilos principales */
:root {
  /* Paleta de colores */
  --c-navy: #0D3B66;
  --c-blue: #1E6091;
  --c-sky: #0EA5E9;
  --c-cta: #FFB703;
  --c-success: #10B981;
  --c-text: #1F2937;
  --c-text-inv: #F8FAFC;
  --c-bg: #FFFFFF;
  --c-bg-soft: #F1F5F9;
  --c-border: #E5E7EB;
}

/* Reset y base */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.6;
}

a {
  color: var(--c-blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Layout principal */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.logo {
  font-weight: 800;
  color: var(--c-navy);
  font-size: 1.125rem;
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
}

/* New logo container styles */
.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-container:hover {
  text-decoration: none;
}

.main-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
}

.main-logo:hover {
  text-decoration: none;
}

.logo-text {
  font-weight: 800;
  color: var(--c-navy);
  font-size: 1.125rem;
  line-height: 1.2;
}

.powered-by {
  font-size: 0.6rem;
  color: var(--c-blue);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: -2px;
}

.mtit-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.menu {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu a {
  font-weight: 600;
  color: var(--c-text);
  padding: 8px 12px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.menu a:hover {
  background-color: var(--c-bg-soft);
  text-decoration: none;
}

/* Language Selector */
.language-selector {
  position: relative !important;
  display: inline-block;
}

.language-btn {
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--c-text);
  text-decoration: none;
}

.language-btn:hover {
  background-color: var(--c-blue);
  color: var(--c-text-inv);
  text-decoration: none;
}

.language-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 120px;
  z-index: 1000;
  display: none;
}

.language-dropdown.show {
  display: block;
}

.language-option {
  display: block;
  padding: 8px 12px;
  color: var(--c-text);
  text-decoration: none;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--c-border);
}

.language-option:hover {
  background-color: var(--c-bg-soft);
  text-decoration: none;
}

.language-option:last-child {
  border-bottom: none;
}

.language-option.active {
  background-color: var(--c-blue);
  color: var(--c-text-inv);
}

.badge {
  background: var(--c-bg-soft);
  color: var(--c-blue);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}

.badge:hover {
  text-decoration: none;
}

/* Hero */
.hero {
  padding: 56px 0;
  background: linear-gradient(180deg, #fff, #f8fafc);
  text-align: center;
}

.hero h1 {
  color: var(--c-navy);
  font-size: 2.5rem;
  margin: 0.5rem 0;
  font-weight: 800;
}

.hero p {
  max-width: 700px;
  margin: 0 auto 2rem auto;
  font-size: 1.125rem;
  color: #6B7280;
}

/* Botones */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: 0.2s transform ease, 0.2s box-shadow ease;
  cursor: pointer;
  text-decoration: none;
  font-size: 1rem;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(13, 59, 102, 0.12);
  text-decoration: none;
}

.btn-primary {
  background: var(--c-cta);
  color: #111827;
}

.btn-secondary {
  background: var(--c-blue);
  color: var(--c-text-inv);
}

.btn-outline {
  background: transparent;
  color: var(--c-blue);
  border-color: var(--c-blue);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.875rem;
}

/* Secciones */
.section {
  padding: 40px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 2rem;
}

.section-title h2 {
  color: var(--c-navy);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.section-title p {
  color: #6B7280;
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 2rem;
}

.card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.card h3 {
  margin-top: 0;
  color: var(--c-navy);
  font-size: 1.25rem;
}

.card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  fill: var(--c-blue);
}

/* Tabla */
.table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--c-border);
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.table th,
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--c-border);
  text-align: left;
}

.table thead th {
  background: var(--c-bg-soft);
  color: #0f172a;
  font-weight: 600;
  position: sticky;
  top: 0;
}

.table tr:hover {
  background: #fafafa;
}

.table tr:last-child td {
  border-bottom: none;
}

/* Alertas */
.alert-warning {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #bbf7d0;
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
}

.alert-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--c-text);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--c-blue);
  box-shadow: 0 0 0 3px rgba(30, 96, 145, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* Vehicle Profile */
.profile-header {
  background: var(--c-bg-soft);
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  text-align: center;
}

.profile-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem auto;
  border: 4px solid var(--c-bg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.rating {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 1rem 0;
}

.star {
  color: #fbbf24;
  font-size: 1.5rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 2rem;
}

.gallery img {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

@media (min-width: 1024px) {
  .steps {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1023px) and (min-width: 768px) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

.step {
  text-align: center;
  padding: 2rem 1.5rem;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.step:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.step-number {
  width: 48px;
  height: 48px;
  background: var(--c-blue);
  color: var(--c-text-inv);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0 auto 1rem auto;
}

.step .card-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem auto;
  fill: var(--c-blue);
  display: block;
}

.step h3 {
  color: var(--c-navy);
  font-size: 1.25rem;
  margin: 0 0 1rem 0;
}

.step p {
  color: #6B7280;
  line-height: 1.6;
  margin: 0 0 1rem 0;
}

.step ul {
  text-align: left;
  margin: 1rem auto;
  display: inline-block;
  color: #6B7280;
}

.step .cards {
  margin-top: 1.5rem;
}

.step .card h4 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--c-navy);
}

/* Footer */
.footer {
  border-top: 1px solid var(--c-border);
  padding: 24px 0;
  background: #fff;
  margin-top: 3rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  color: var(--c-navy);
  margin-bottom: 1rem;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section li {
  margin-bottom: 0.5rem;
}

.footer-bottom {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--c-border);
}

.footer-bottom small {
  color: #6B7280;
}

/* Responsive */
@media (max-width: 900px) {
  .cards {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  
  .nav {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  /* Logo responsivo en móvil */
  .logo-container {
    gap: 8px;
  }
  
  .logo-text {
    font-size: 1rem;
  }
  
  .powered-by {
    font-size: 0.55rem;
  }
  
  .mtit-logo {
    height: 28px;
  }
  
  .menu {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .cards {
    grid-template-columns: 1fr;
  }
  
  .steps {
    grid-template-columns: 1fr;
  }
  
  /* Tabla responsive - convertir a cards en móvil */
  .table-responsive {
    display: none;
  }
  
  .table-cards {
    display: block;
  }
  
  .table-card {
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .table-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
    min-height: 2rem;
  }
  
  .table-card-row:last-child {
    border-bottom: none;
  }
  
  .table-card-label {
    font-weight: 600;
    color: var(--c-navy);
    flex: 0 0 auto;
    margin-right: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 45%;
  }
  
  .table-card-row > span:last-child {
    flex: 1;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Asegurar que el contenido bilingüe en las filas se mantenga en línea */
  .table-card-row .en-content,
  .table-card-row .es-content {
    display: inline !important;
  }
}

@media (min-width: 769px) {
  .table-responsive {
    display: block;
  }
  
  .table-cards {
    display: none;
  }
}

/* Estados de focus para accesibilidad */
.btn:focus-visible,
.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible {
  outline: 2px solid var(--c-blue);
  outline-offset: 2px;
}

/* Respeta preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Utilidades */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Language switching */
[lang="en"] .es-content,
[lang="es"] .en-content {
  display: none !important;
}

[lang="en"] .en-content,
[lang="es"] .es-content {
  display: inline;
}

/* Inline language switching */
[lang="en"] .es-inline,
[lang="es"] .en-inline {
  display: none !important;
}

[lang="en"] .en-inline,
[lang="es"] .es-inline {
  display: inline;
}

/* Paginación */
.pagination-wrapper {
  margin-top: 2rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--c-border);
}

.pagination-info {
  text-align: center;
  margin-bottom: 1rem;
}

.pagination-info p {
  color: #6B7280;
  font-size: 0.875rem;
  margin: 0;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 0.375rem;
  color: var(--c-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.page-btn:hover {
  background: var(--c-bg-soft);
  border-color: var(--c-blue);
  color: var(--c-blue);
  text-decoration: none;
}

.page-btn:active {
  transform: translateY(1px);
}

.page-info {
  background: var(--c-bg-soft);
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-text);
  border: 1px solid var(--c-border);
}

@media (max-width: 768px) {
  .pagination {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .page-btn {
    width: 100%;
    justify-content: center;
  }
  
  .pagination-info p {
    font-size: 0.8rem;
  }
}

/* reCAPTCHA Modal */
.recaptcha-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.recaptcha-modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.recaptcha-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--c-border);
}

.recaptcha-modal-header h3 {
  margin: 0;
  color: var(--c-navy);
  font-size: 1.25rem;
  font-weight: 600;
}

.recaptcha-close {
  font-size: 1.5rem;
  color: #9CA3AF;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.recaptcha-close:hover {
  background-color: #F3F4F6;
  color: #374151;
}

.recaptcha-modal-body {
  padding: 1.5rem;
}

.recaptcha-modal-body p {
  margin-bottom: 1.5rem;
  color: #6B7280;
  line-height: 1.6;
}

.recaptcha-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

.recaptcha-buttons .btn {
  min-width: 100px;
}

.recaptcha-buttons .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.recaptcha-buttons .btn:disabled:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* Responsive modal */
@media (max-width: 768px) {
  .recaptcha-modal-content {
    width: 95%;
    margin: 1rem;
  }
  
  .recaptcha-modal-header,
  .recaptcha-modal-body {
    padding: 1rem;
  }
  
  .recaptcha-buttons {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .recaptcha-buttons .btn {
    width: 100%;
    min-width: auto;
  }
}

/* Ajustes para reCAPTCHA widget */
.g-recaptcha {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}

/* Loading state */
.recaptcha-loading {
  display: none;
  text-align: center;
  padding: 1rem;
  color: #6B7280;
}

.recaptcha-loading.show {
  display: block;
}

.recaptcha-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--c-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

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