/* styles.css */
/* Estilos generales para todas las páginas de Obras */

:root {
  --color-bg: #f5f5f5;
  --color-primary: #007bff;
  --color-secondary: #6c757d;
  --color-danger: #dc3545;
  --color-text: #222;
  --color-muted: #555;
  --radius: 8px;
  --shadow-soft: 0 2px 6px rgba(0,0,0,0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

.page-header {
  text-align: center;
  margin-bottom: 16px;
}

.page-title {
  font-size: 22px;
  margin: 0 0 6px 0;
}

.page-subtitle {
  font-size: 14px;
  color: var(--color-muted);
  margin: 0;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 14px;
}

input[type="text"],
input[type="number"],
input[type="date"],
textarea,
input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--color-primary);
}

textarea {
  min-height: 70px;
  resize: vertical;
}

.field {
  margin-bottom: 12px;
}

.field-inline {
  display: flex;
  gap: 8px;
}

.field-inline .field {
  flex: 1;
  margin-bottom: 0;
}

.btn {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  margin-top: 8px;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-secondary {
  background: var(--color-secondary);
  color: #fff;
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
  font-size: 13px;
  padding: 8px 10px;
  width: auto;
}

.btn-disabled {
  opacity: 0.6;
  cursor: default;
}

.back-link {
  font-size: 14px;
  margin-bottom: 12px;
  display: inline-block;
  color: var(--color-primary);
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.matricula-highlight {
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 6px;
  background: #eef3ff;
  display: inline-block;
}

/* Foto rápida */

#previewFoto {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  background: #ccc;
  margin-top: 8px;
  display: none;
  border-radius: 6px;
}

/* Mapa */

#map,
#mapCenso {
  width: 100%;
  height: 320px;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 8px 0 12px 0;
}

/* Info */

.info-ubicacion {
  font-size: 13px;
  color: var(--color-muted);
  margin-bottom: 8px;
  text-align: center;
}

.loader {
  text-align: center;
  font-size: 14px;
  color: var(--color-muted);
  margin-top: 8px;
  display: none;
}

/* Secciones del formulario largo */

.section-title {
  font-size: 16px;
  font-weight: 700;
  margin: 16px 0 8px 0;
  border-left: 4px solid var(--color-primary);
  padding-left: 8px;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 14px;
}

.radio-group label {
  font-weight: normal;
}

.switch-row {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
}

/* Fotos múltiples */

.photos-input {
  margin-bottom: 8px;
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.photos-grid img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  background: #ddd;
}

/* Responsivo básico */

@media (min-width: 768px) {
  .page {
    padding: 24px;
  }

  .page-title {
    font-size: 24px;
  }
}
