﻿/* RESET */
* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Segoe UI', Arial, sans-serif;
}

/* FONDO PANTALLA COMPLETA */
.background {
    background: url('../img/fondo.jpg') no-repeat center center;
    background-size: cover;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    filter: blur(0px);
    z-index: 1;
}

/* MODAL */
.modal {
    background: #ffffff;
    max-width: 900px;
    margin: 60px auto;
    padding: 30px;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    position: relative;
    z-index: 10;
    top: 0px;
    left: 0px;
}

/* LOGO */
.logo-container {
    text-align: center;
    margin-bottom: 15px;
}

.logo {
    width: 160px;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

/* TITULOS */
h1 {
    text-align: center;
    margin: 5px 0;
    font-size: 26px;
}

h2 {
    text-align: center;
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #555;
}

/* SECCION */
.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1e293b;
    background: rgba(37, 99, 235, 0.08);
    padding: 10px 15px;
    border-radius: 10px;
}


/* GRID CAMPOS */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.full {
    grid-column: span 3;
}

/* LABELS */
label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
}

/* INPUTS */
.input {
    width: 100%;
    padding: 9px;
    border-radius: 8px;
    border: 1px solid #c6d4f5;
    font-size: 14px;
    transition: 0.2s ease;
}

.input:focus {
    outline: none;
    border-color: #1f4fd8;
    box-shadow: 0 0 0 2px rgba(31,79,216,0.25);
}

/* BOTON */
.btn {
    margin-top: 25px;
    width: 100%;
    padding: 13px;
    background: #1f4fd8;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn:hover {
    background: #163ca3;
}

/* VALIDADORES */
.error {
    background: #e74c3c;
    color: #ffffff;
    font-size: 11px;
    padding: 5px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 5px;
    font-weight: 600;
}

/* MENSAJE EXITO */
.success {
    display: block;
    margin-top: 15px;
    text-align: center;
    color: #2e7d32;
    font-weight: bold;
    font-size: 14px;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .full {
        grid-column: span 2;
    }
}

@media (max-width: 500px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .full {
        grid-column: span 1;
    }

    .modal {
        margin: 20px;
        padding: 20px;
    }

    .logo {
        width: 120px;
    }
}
.section-title {
    background: #6b6b6b;
    color: white;
    padding: 8px;
    margin-top: 25px;
    font-weight: bold;
    text-align: center;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.full {
    grid-column: span 3;
}

label {
    font-size: 13px;
    font-weight: bold;
    margin-top: 0px;
}

.input {
    width: 100%;
    padding: 6px;
    border: 1px solid black;
    font-size: 14px;
    background: white;
}
.triple-row {
    display: flex;
    gap: 15px;
}

.triple-row > div {
    flex: 1;
}
.section-title {
    animation: slideIn 0.6s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.input {
    transition: all 0.2s ease;
}

.input:focus {
    border-color: #2f80ed;
    box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.2);
    transform: scale(1.02);
}


/* ========================= */
/* TARJETAS ANIMADAS */
/* ========================= */

.card {
    background: linear-gradient(145deg, #ffffff, #f1f5f9);
    border-radius: 18px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 
        0 20px 45px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    animation: fadeUp 0.7s ease forwards;
    border-left: 6px solid #2563eb;
}

/* Animación de entrada */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================= */
/* CAMPOS CON EFECTO CASCADA */
/* ========================= */

.grid > div {
    opacity: 0;
    transform: translateY(20px);
    animation: fieldFade 0.5s ease forwards;
}

@keyframes fieldFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Delay automático tipo dominó */
.grid > div:nth-child(1) { animation-delay: 0.05s; }
.grid > div:nth-child(2) { animation-delay: 0.10s; }
.grid > div:nth-child(3) { animation-delay: 0.15s; }
.grid > div:nth-child(4) { animation-delay: 0.20s; }
.grid > div:nth-child(5) { animation-delay: 0.25s; }
.grid > div:nth-child(6) { animation-delay: 0.30s; }
.grid > div:nth-child(7) { animation-delay: 0.35s; }
.grid > div:nth-child(8) { animation-delay: 0.40s; }
.grid > div:nth-child(9) { animation-delay: 0.45s; }
.grid > div:nth-child(10) { animation-delay: 0.50s; }
.grid > div:nth-child(11) { animation-delay: 0.55s; }
.grid > div:nth-child(12) { animation-delay: 0.60s; }
.grid > div:nth-child(13) { animation-delay: 0.65s; }
.grid > div:nth-child(14) { animation-delay: 0.70s; }
.grid > div:nth-child(15) { animation-delay: 0.75s; }

/* ========================= */
/* INPUTS VIVOS */
/* ========================= */

.input {
    transition: all 0.2s ease;
}

.input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
    transform: scale(1.02);
}

/* ========================= */
/* MOBILE FIRST REAL */
/* ========================= */

@media (max-width: 480px) {

    body, html {
        font-size: 15px;
    }

    /* Modal ocupa casi toda la pantalla */
    .modal {
        width: 95vw;
        margin: 10px auto;
        padding: 18px;
        border-radius: 12px;
    }

    /* Logo más compacto */
    .logo {
        width: 100px;
    }

    /* Títulos más chicos */
    h1 {
        font-size: 20px;
    }

    h2 {
        font-size: 14px;
    }

    /* Secciones más compactas */
    .section-title {
        font-size: 14px;
        padding: 8px;
    }

    /* Grid en una sola columna */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .full {
        grid-column: span 1;
    }

    /* Inputs grandes para dedos */
    .input {
        padding: 12px;
        font-size: 16px;
        border-radius: 10px;
    }

    /* Evita zoom automático en iPhone */
    input, select, textarea {
        font-size: 16px;
    }

    /* Botón grande y cómodo */
    .btn {
        padding: 15px;
        font-size: 17px;
        border-radius: 12px;
    }

    /* Mensajes más legibles */
    .error {
        font-size: 12px;
        padding: 6px 10px;
    }

    .success {
        font-size: 15px;
    }

    /* Animaciones más suaves en móvil (menos lag) */
    .grid > div {
        animation-duration: 0.3s;
    }

    .card {
        padding: 20px;
        margin-bottom: 25px;
    }
}
/* ========================= */
/* IMPRESIÓN OFICIAL - BLOQUE ÚNICO */
/* ========================= */

@media print {

  @page {
    size: A4 portrait;
    margin: 10mm;
  }

  html, body {
    background: white !important;
  }

  /* Ocultar fondo y botones */
  .background,
  .btn,
  .btn-print {
    display: none !important;
  }

  /* Formulario normal, SIN TRANSFORM */
  .modal {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 10px !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  /* Tarjetas limpias */
  .card {
    padding: 8px !important;
    margin-bottom: 8px !important;
    box-shadow: none !important;
    border-left: 2px solid black !important;
    page-break-inside: avoid;
  }

  /* Títulos compactos */
  h1 {
    font-size: 16px !important;
    margin: 4px 0 !important;
  }

  h2 {
    font-size: 11px !important;
    margin: 0 0 6px 0 !important;
  }

  .section-title {
    font-size: 11px !important;
    padding: 4px !important;
    background: #eee !important;
    color: black !important;
    text-align: center !important;
  }

  /* Grid estable */
  .grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 5px !important;
  }

  label {
    font-size: 10px !important;
  }

  .input {
    font-size: 10px !important;
    padding: 3px !important;
    border: 1px solid black !important;
    background: white !important;
    box-shadow: none !important;
  }

  /* Logo */
  .logo {
    width: 80px !important;
    display: block !important;
    margin: 0 auto 5px auto !important;
  }

  /* Sin animaciones */
  * {
    animation: none !important;
    transition: none !important;
  }
}
.seccion-bloque {
    page-break-inside: avoid;
    break-inside: avoid;
    page-break-before: auto;
}
.header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.fecha-box {
    font-size: 11px;
    text-align: right;
    min-width: 180px;
    margin-top: 12px; /* Esto la baja al nivel visual del primer bloque */
}

.subtitulo {
    font-size: 12px;
    font-weight: normal;
}
