/**
 * AutoJusto - Estilos base compartidos (shadcn-like, CSS puro)
 */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.screen-enter {
  animation: slideUp 0.35s ease-out;
}

.animate-slide-up {
  animation: slideUp 0.3s ease-out;
}

.card {
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  padding: 1rem;
}

@media (min-width: 768px) {
  .card { padding: 1.5rem; }
}

.card-selectable {
  border-radius: 0.75rem;
  border: 2px solid #e5e7eb;
  background: #fff;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.card-selectable:hover {
  border-color: #60A5FA;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.card-selectable.selected {
  border-color: #1E3A8A;
  background: rgba(239,246,255,0.5);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.card-selectable--muted {
  border-style: dashed;
  background: #f9fafb;
}

.card-selectable--muted.selected {
  border-color: #6b7280;
  background: #f3f4f6;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1E3A8A;
  color: #fff;
  border-radius: 0.5rem;
  height: 3rem;
  padding: 0 1.5rem;
  font-weight: 500;
  width: 100%;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
  font-size: 0.9375rem;
}

.btn-primary:hover { background: #2563EB; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #1f2937;
  border-radius: 0.5rem;
  height: 3rem;
  padding: 0 1.5rem;
  font-weight: 500;
  width: 100%;
  transition: background 0.2s;
  cursor: pointer;
  font-size: 0.9375rem;
}

.btn-secondary:hover { background: #f9fafb; }

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #16A34A;
  color: #fff;
  border-radius: 0.5rem;
  height: 3rem;
  padding: 0 1.5rem;
  font-weight: 500;
  width: 100%;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
}

.btn-action:hover { background: #15803d; }

.btn-outline-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #1E3A8A;
  color: #1E3A8A;
  background: transparent;
  border-radius: 0.5rem;
  height: 3rem;
  padding: 0 1.5rem;
  font-weight: 500;
  width: 100%;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-outline-brand:hover {
  background: #1E3A8A;
  color: #fff;
}

.input-field {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  height: 2.75rem;
  padding: 0 0.75rem;
  color: #111827;
  font-size: 1rem;
  transition: box-shadow 0.2s;
}

.input-field:focus {
  outline: none;
  box-shadow: 0 0 0 2px #60A5FA;
  border-color: #1E3A8A;
}

.input-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.375rem;
}

.alert-soft {
  border-radius: 0.5rem;
  border-left: 4px solid #1E3A8A;
  background: rgba(239,246,255,0.6);
  padding: 1rem;
  font-size: 0.875rem;
  color: #374151;
}

.alert-info {
  border-radius: 0.5rem;
  border-left: 4px solid #60A5FA;
  background: #f0f9ff;
  padding: 1rem;
  font-size: 0.875rem;
  color: #374151;
}

.alert-warning {
  border-radius: 0.5rem;
  border-left: 4px solid #F97316;
  background: #fff7ed;
  padding: 1rem;
  font-size: 0.875rem;
  color: #374151;
}

.progress-track {
  height: 0.5rem;
  border-radius: 9999px;
  background: #e5e7eb;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: #1E3A8A;
  transition: width 0.5s ease-out;
  width: 0%;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #4b5563;
  line-height: 1.625;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 0.125rem;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  accent-color: #1E3A8A;
}

.table-wrap {
  overflow-x: auto;
  margin-left: -1rem;
  margin-right: -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 768px) {
  .table-wrap { margin: 0; padding: 0; }
}

.data-table {
  width: 100%;
  font-size: 0.875rem;
  min-width: 480px;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem;
  background: #f9fafb;
}

.data-table td {
  padding: 0.75rem;
  border-top: 1px solid #f3f4f6;
  color: #374151;
}

.data-table tr:nth-child(even) td {
  background: rgba(249,250,251,0.5);
}

.data-table .amount-negative { color: #DC2626; }
.data-table .amount-positive { color: #16A34A; }
.data-table .amount-total { font-weight: 700; color: #1E3A8A; }

.whatsapp-fab {
  position: fixed;
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  right: max(1rem, env(safe-area-inset-right));
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #25D366;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 9999px;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.whatsapp-fab:hover {
  transform: scale(1.05);
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.site-footer {
  text-align: center;
  font-size: 0.75rem;
  color: #9ca3af;
  padding: 1.5rem 0;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}

.spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 3px solid #60A5FA;
  border-top-color: #1E3A8A;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.date-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 3.5rem;
  height: 4rem;
  border-radius: 0.75rem;
  border: 2px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0.25rem;
}

.date-chip:hover { border-color: #60A5FA; }
.date-chip.selected { border-color: #1E3A8A; background: #1E3A8A; color: #fff; }
.date-chip.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.time-chip {
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.time-chip:hover { border-color: #1E3A8A; color: #1E3A8A; }
.time-chip.selected { border-color: #1E3A8A; background: #1E3A8A; color: #fff; }

.photo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.photo-item.completed {
  border-color: rgba(22,163,74,0.3);
  background: rgba(240,253,244,0.5);
}

.modal-overlay:not(.hidden) {
  animation: fadeIn 0.2s ease-out;
}

.header-logo {
  height: 2rem;
  width: auto;
  object-fit: contain;
}

@media (min-width: 768px) {
  .header-logo { height: 2.5rem; }
}

.select-field {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  height: 2.75rem;
  padding: 0 0.75rem;
  color: #111827;
  font-size: 1rem;
  background: #fff;
}

.textarea-field {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  padding: 0.75rem;
  color: #111827;
  font-size: 1rem;
  min-height: 6rem;
  resize: vertical;
}

.textarea-field:focus,
.select-field:focus {
  outline: none;
  box-shadow: 0 0 0 2px #60A5FA;
  border-color: #1E3A8A;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.radio-chip {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  background: #fff;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.radio-chip:hover { border-color: #1E3A8A; }
.radio-chip.selected { border-color: #1E3A8A; background: #1E3A8A; color: #fff; }

.hidden { display: none !important; }
