:root {
  --primary: #2563eb;
  --success: #22c55e;
  --bg: #f4f7fb;
  --text: #1f2937;
  --muted: #6b7280;
  --radius: 22px;
  --shadow: 0 10px 35px rgba(0, 0, 0, 0.08);
  --brand-shadow: 0 12px 40px rgba(37, 99, 235, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1180px;
}

/* ===== BRAND / LOGO PROFESIONAL (más grande) ===== */
.brand-card {
  background: #ffffff;
  border-radius: 32px;
  padding: 2.8rem 2rem 2.2rem; /* más padding */
  box-shadow: var(--brand-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.brand-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 50px rgba(37, 99, 235, 0.18);
}

.brand-logo-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.75rem;
}

.brand-logo {
  display: block;
  max-width: 260px; /* antes 220px */
  width: 100%;
  height: auto;
  transition: transform 0.35s ease;
}

.brand-logo:hover {
  transform: scale(1.03);
}

.brand-title {
  font-size: 2.6rem; /* antes 2.2rem */
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0.25rem 0 0.1rem;
  color: var(--text);
}

.brand-subtitle {
  font-size: 1.1rem; /* antes 1rem */
  color: var(--muted);
  margin: 0;
  font-weight: 400;
  letter-spacing: 0.3px;
}

/* ===== SECCIONES ===== */
.section {
  background: #fff;
  border-radius: 24px;
  padding: 38px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.section:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.07);
}

.search-title {
  font-size: 2rem;
  font-weight: 700;
}

.login-title {
  font-size: 1.6rem;
  font-weight: 700;
}

.text-muted {
  color: var(--muted) !important;
}

.form-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-control,
.form-select {
  border-radius: 16px;
  border: 1px solid #d7dee8;
  min-height: 58px;
  padding: 0 18px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.15);
}

/* ===== INPUT GROUP (BÚSQUEDA) ===== */
.input-group {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.input-group .form-control {
  flex: 1;
  border-radius: 16px 0 0 16px;
  height: 62px;
  font-size: 18px;
}

.search-input {
  font-size: 18px;
}

.search-button {
  min-width: 180px;
  height: 62px;
  font-size: 20px;
  border-radius: 0 16px 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ff8a00;
  border: none;
  font-weight: 700;
  transition: background 0.2s, transform 0.2s;
}

.search-button:hover {
  background: #ff7300;
  transform: translateY(-2px);
}

/* ===== BOTONES ===== */
.btn {
  border: none;
  border-radius: 16px;
  padding: 0.9rem 1.5rem;
  font-weight: 700;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.btn-primary {
  background: linear-gradient(90deg, #1f5fff, #2563eb);
}

.btn-success {
  background: linear-gradient(90deg, #28a745, #36c05c);
}

/* ===== DONACIÓN ===== */
.donation {
  background: linear-gradient(90deg, #f2fff4, #ffffff);
  border-left: 8px solid var(--success);
}

.donation-icon {
  font-size: 52px;
  margin-right: 20px;
  flex-shrink: 0;
}

.donation-btn-wrap {
  flex-shrink: 0;
  margin-left: 10px;
}

/* ===== INFO BOX ===== */
.info-box {
  border-left: 8px solid var(--primary);
  background: white;
}

/* ===== FOOTER ===== */
footer {
  padding: 25px 0;
  text-align: center;
  color: var(--muted);
}

footer hr {
  border-color: rgba(0, 0, 0, 0.05);
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
  .section {
    padding: 28px;
  }
  .brand-logo {
    max-width: 220px; /* intermedio */
  }
  .brand-title {
    font-size: 2.2rem;
  }
  .search-title {
    font-size: 1.6rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }

  .brand-card {
    padding: 2rem 1rem 1.8rem;
    border-radius: 24px;
  }

  .brand-logo {
    max-width: 200px; /* antes 150px, ahora más grande */
  }

  .brand-title {
    font-size: 2rem; /* antes 1.6rem */
  }

  .brand-subtitle {
    font-size: 1rem; /* antes 0.9rem */
  }

  .section {
    padding: 20px;
    border-radius: 18px;
    margin-bottom: 20px;
  }

  .search-title {
    font-size: 1.4rem;
    text-align: center;
  }
  .login-title {
    font-size: 1.2rem;
    text-align: center;
  }

  /* Input group en columna */
  .input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }
  .input-group .form-control {
    width: 100%;
    height: 58px;
    border-radius: 16px !important;
    font-size: 18px;
  }
  .search-button {
    width: 100%;
    height: 58px;
    border-radius: 16px !important;
    font-size: 20px;
  }

  .btn {
    width: 100%;
  }
  .form-control {
    height: 58px;
  }

  .donation-icon {
    font-size: 40px;
    margin-right: 15px;
  }
  .donation-btn-wrap {
    width: 100%;
    margin-left: 0;
    margin-top: 10px;
  }
}

/* ============================================
   ESTILOS PARA LA FICHA DE DETALLE (child.php)
   ============================================ */

/* Tarjeta de perfil */
.profile-card {
    background: #ffffff;
    border-radius: 28px;
    padding: 2rem 1.8rem;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    margin-bottom: 2rem;
}

.profile-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.07);
}

/* Foto */
.photo-wrapper {
    background: #f8fafc;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.profile-photo {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.profile-photo:hover {
    transform: scale(1.02);
}

/* Badges de prioridad y estado */
.priority-badge,
.status-badge {
    font-size: 1rem;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Nombre del perfil */
.profile-name {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

/* Lista de detalles */
.profile-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    border-bottom: 1px solid #f0f2f5;
    padding-bottom: 0.6rem;
}

.detail-row:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-label {
    width: 140px;
    font-weight: 600;
    color: var(--muted);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.detail-value {
    flex: 1;
    font-weight: 500;
    word-break: break-word;
}

.code-highlight {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

/* Código destacado en la sección de reconocimiento */
.code-badge {
    display: inline-block;
    background: #eef2ff;
    color: var(--primary);
    font-size: 2.5rem;
    font-weight: 800;
    padding: 0.5rem 3rem;
    border-radius: 60px;
    letter-spacing: 2px;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.15);
}

/* Sección de acción */
.action-section {
    background: #ffffff;
    border-radius: 28px;
    padding: 2rem 1.8rem;
    box-shadow: var(--shadow);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
    .profile-card {
        padding: 1.5rem;
    }
    .profile-name {
        font-size: 1.9rem;
        margin-top: 0.5rem;
    }
    .detail-label {
        width: 120px;
        font-size: 0.9rem;
    }
    .code-badge {
        font-size: 2rem;
        padding: 0.4rem 2rem;
    }
}

@media (max-width: 576px) {
    .profile-card {
        padding: 1.2rem;
        border-radius: 20px;
    }
    .profile-name {
        font-size: 1.6rem;
        text-align: center;
    }
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
        padding-bottom: 0.8rem;
    }
    .detail-label {
        width: 100%;
        font-size: 0.85rem;
    }
    .detail-value {
        font-size: 0.95rem;
        width: 100%;
    }
    .priority-badge,
    .status-badge {
        font-size: 0.85rem;
        padding: 0.4rem 0.9rem;
    }
    .code-badge {
        font-size: 1.8rem;
        padding: 0.3rem 1.5rem;
    }
    .photo-wrapper {
        max-width: 320px;
        margin: 0 auto;
    }
}


/* ============================================
   ESTILOS PARA LA SOLICITUD DE REUNIFICACIÓN
   ============================================ */

/* Resumen del menor en la solicitud */
.child-summary {
    background: #f8fafc;
    border-radius: 20px;
    padding: 1.5rem 1.2rem;
    transition: background 0.3s;
}

.child-summary:hover {
    background: #f1f5f9;
}

.small-photo {
    max-width: 180px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.small-photo .profile-photo {
    max-height: 180px;
    object-fit: cover;
}

.summary-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.summary-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.3rem 0.5rem;
}

.summary-label {
    font-weight: 600;
    color: var(--muted);
    font-size: 0.9rem;
    min-width: 120px;
}

.summary-value {
    font-weight: 500;
    font-size: 1rem;
}

/* Estilos para los campos de archivo */
.file-upload-wrapper {
    position: relative;
    overflow: hidden;
}

.file-upload-wrapper .file-input {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.file-upload-wrapper .file-placeholder {
    display: block;
    width: 100%;
    padding: 0.8rem 1rem;
    background: #f8fafc;
    border: 2px dashed #d7dee8;
    border-radius: 16px;
    text-align: center;
    color: var(--muted);
    font-weight: 500;
    transition: border-color 0.3s, background 0.3s;
    pointer-events: none;
}

.file-upload-wrapper:hover .file-placeholder {
    border-color: var(--primary);
    background: #eef2ff;
}

/* Ajustes responsive para el resumen */
@media (max-width: 576px) {
    .child-summary {
        padding: 1rem;
    }
    .small-photo {
        max-width: 140px;
    }
    .small-photo .profile-photo {
        max-height: 140px;
    }
    .summary-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.1rem;
    }
    .summary-label {
        min-width: unset;
        font-size: 0.8rem;
    }
    .summary-value {
        font-size: 0.95rem;
    }
    .file-upload-wrapper .file-placeholder {
        font-size: 0.9rem;
        padding: 0.6rem;
    }
}

/* ============================================
   ESTILOS PARA LA PÁGINA DE BÚSQUEDA (search.php)
   ============================================ */

/* Formulario de búsqueda */
.search-form .input-group {
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border-radius: 60px;
    overflow: hidden;
}

.search-form .form-control {
    border: 2px solid #e2e8f0;
    border-right: none;
    border-radius: 60px 0 0 60px;
    height: 62px;
    font-size: 1.1rem;
    padding-left: 24px;
    transition: border-color 0.3s;
}

.search-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: none;
}

.search-form .search-button {
    border-radius: 0 60px 60px 0;
    min-width: 160px;
    height: 62px;
    font-size: 1.1rem;
    font-weight: 700;
}

/* Encabezado de resultados */
.results-header {
    margin: 1.5rem 0 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-header h4 {
    font-weight: 600;
    color: var(--text);
}

.results-header .badge {
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
}

/* Tarjeta de resultado */
.result-card {
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.result-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.08);
}

.result-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #f8fafc;
}

.result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.result-card:hover .result-image img {
    transform: scale(1.04);
}

.result-body {
    padding: 1.5rem 1.25rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.result-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.result-code {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.result-place {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.result-status {
    margin-bottom: 0.5rem;
}

.result-status .badge {
    font-size: 0.9rem;
    padding: 0.35rem 0.8rem;
}

.priority-badge {
    font-size: 0.9rem;
    padding: 0.4rem 1rem;
    border-radius: 999px;
}

/* Estado vacío */
.empty-state {
    padding: 3rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .search-form .input-group {
        flex-direction: column;
        border-radius: 24px;
        box-shadow: none;
        gap: 12px;
    }

    .search-form .form-control {
        border-radius: 60px !important;
        border: 2px solid #e2e8f0;
        height: 56px;
        font-size: 1rem;
        padding-left: 20px;
    }

    .search-form .search-button {
        border-radius: 60px !important;
        min-width: 100%;
        height: 56px;
        font-size: 1.1rem;
    }

    .results-header {
        justify-content: center;
        text-align: center;
        flex-wrap: wrap;
    }

    .result-card {
        border-radius: 20px;
    }

    .result-image {
        height: 180px;
    }

    .result-body {
        padding: 1.2rem 1rem;
    }

    .result-name {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .result-image {
        height: 160px;
    }
}

/* Mensaje de error mejorado */
.alert-danger {
    border-left: 6px solid #dc3545;
    background: #fff5f5;
    border-radius: 20px !important;
    padding: 1.2rem 1.5rem;
}

.alert-danger strong {
    display: block;
    font-size: 1.1rem;
}