@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #6b7fd7;
  --primary-dark: #5a6bc4;
  --bg-gradient-start: #6b7fd7;
  --bg-gradient-end: #8b6bd7;
  --text-dark: #2d3748;
  --text-muted: #718096;
  --border: #e2e8f0;
  --card-bg: #ffffff;
  --shadow: 0 10px 25px rgba(107, 127, 215, 0.15);
  --input-bg: #f7fafc;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  background-attachment: fixed;
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 900px;
  animation: fadeInUp 0.6s ease-out;
}

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

.card {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 48px 40px;
  box-shadow: var(--shadow);
  text-align: center;
}

.logo-container {
  margin-bottom: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-container img {
  max-width: 280px;
  height: auto;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 32px;
  line-height: 1.5;
}

.info-box {
  background: rgba(107, 127, 215, 0.08);
  border: 1px solid rgba(107, 127, 215, 0.2);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: left;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  text-align: left;
}

label {
  color: var(--text-dark);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 8px;
}

input, select {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--text-dark);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
  outline: none;
}

input:focus, select:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(107, 127, 215, 0.1);
}

input:hover, select:hover {
  border-color: var(--primary);
}

button {
  width: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(107, 127, 215, 0.3);
  margin-top: 8px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(107, 127, 215, 0.4);
}

button:active {
  transform: translateY(0);
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-dark);
  text-align: left;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-dark);
  text-align: left;
}

.muted {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
  background: var(--input-bg);
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  border-left: 3px solid var(--primary);
  text-align: left;
}

.muted strong {
  color: var(--primary);
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 20px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border);
  table-layout: fixed;
}

th, td {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

thead {
  background: var(--input-bg);
}

th {
  padding: 14px 8px;
  text-align: left;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.8rem;
  border-bottom: 2px solid var(--border);
}

td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dark);
  font-size: 0.85rem;
}

tbody tr {
  transition: all 0.2s ease;
}

tbody tr:hover {
  background: var(--input-bg);
}

/* Quitar líneas horizontales entre filas en bloques de servicio y hacer filas más compactas */
table.servicio, .servicio-block table {
  border-collapse: separate;
}
.servicio-block {
  margin-top: 0; /* evitar espacio grande entre bloques */
}
.servicio-block + .servicio-block {
  margin-top: 6px; /* pequeño espacio entre bloques si hay varios */
}
.servicio-block table {
  margin-top: 8px; /* tablas internas más compactas */
  border-radius: 0; /* eliminar radios duplicados dentro del bloque */
  border: none; /* evitar doble borde */
  background: transparent;
}
.servicio-block table tbody tr td {
  border-bottom: none;
  padding: 6px 6px;
  line-height: 1.05; /* reducir interlineado */
  vertical-align: middle;
}

.servicio-block table td.concept {
  /* Permitir que la descripción haga wrap en varias líneas */
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  /* Dar más espacio a la descripción */
  width: 60%;
  max-width: none;
  word-break: break-word;
  text-align: left; /* justificar a la izquierda */
}

/* Asegurar que la primera columna de cada fila (descripción) esté alineada a la izquierda */
.servicio-block table tbody tr td:first-child {
  text-align: left;
  padding-left: 6px;
  vertical-align: middle;
}

/* Encabezado compacto para la sección de servicios (cliente, zona, consumo) */
.servicios-header {
  text-align: left;
  font-size: 0.95rem;
  color: var(--text-dark);
  margin-bottom: 6px;
}

/* Espacio extra entre la tarjeta de Tasa a la Propiedad y la tarjeta de Servicios (Agua/Cloacas) */
#card-propiedad { margin-bottom: 22px; }

/* Asegurar que los bloques de servicio estén visualmente compactos sin saltos grandes */
.servicio-block {
  margin-top: 4px;
  padding-top: 0;
}

/* Alinear los encabezados Cant. y Precio más a la derecha dentro del bloque de servicio */
.servicio-block table thead th:nth-child(2),
.servicio-block table thead th:nth-child(3) {
  text-align: right;
  padding-right: 12px;
}

.servicio-block table thead th:nth-child(4) {
  text-align: right;
}

/* Centrar el encabezado 'Descripción' dentro de su columna */
.servicio-block table thead th:nth-child(1) {
  text-align: center;
}

/* Reservar anchos relativos para columnas: Descripción | Cant. | Precio | Importe */
.servicio-block table td:nth-child(2), .servicio-block table thead th:nth-child(2) {
  width: 12%;
}
.servicio-block table td:nth-child(3), .servicio-block table thead th:nth-child(3) {
  width: 14%;
}
.servicio-block table td:nth-child(4), .servicio-block table thead th:nth-child(4) {
  width: 14%;
}

.c-year {
  text-align: center;
  font-weight: 700;
  color: var(--primary);
}

.c-num {
  text-align: center;
  font-family: 'SF Mono', Monaco, monospace;
  color: var(--text-muted);
}

.c-money {
  text-align: right;
  font-weight: 600;
  color: #10b981;
  font-family: 'SF Mono', Monaco, monospace;
}

.servicios-ersep {
  text-align: right;
  font-weight: 600;
  color: #334d00;
  margin-top: 4px;
}

.servicios-iibb {
  text-align: right;
  font-weight: 600;
  color: #1f4d4d;
  margin-top: 4px;
}

.servicios-iva {
  text-align: right;
  font-weight: 600;
  color: #0b5e3a;
  margin-top: 4px;
}

.servicios-total-final {
  text-align: right;
  font-weight: 800;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 2px solid #bbb;
  font-size: 1.05rem;
}

.notes p {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 12px;
  padding-left: 20px;
  position: relative;
}

.notes p::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

.footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

@media (max-width: 768px) {
  .container {
    max-width: 100%;
  }

  .card {
    padding: 32px 24px;
    border-radius: 20px;
  }

  h1 {
    font-size: 1.75rem;
  }

  .logo-container img {
    max-width: 240px;
  }

  table {
    font-size: 0.85rem;
  }

  th, td {
    padding: 10px 8px;
  }
}

@media (max-width: 640px) {
  body {
    padding: 12px;
  }

  .card {
    padding: 28px 20px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .subtitle {
    font-size: 0.875rem;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}