/* ==========================================================================
   Reset & Base
   ========================================================================== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background-color: #05192d;
  color: #333333;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Contenedor Principal (Fondo azul oscuro y centrado de ventana)
   ========================================================================== */
.page-wrapper {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 12px;
}

/* ==========================================================================
   Ventana / Modal del Certificado
   ========================================================================== */
.cert-window {
  background-color: #ffffff;
  width: 100%;
  max-width: 520px;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.48);
}

/* ==========================================================================
   Banner Superior
   ========================================================================== */
.banner-container {
  width: 100%;
  background-color: #ffffff;
  line-height: 0;
}

.banner-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Placeholder visual por si aún no se agrega el archivo "banner.png" */
.banner-placeholder {
  display: none;
  width: 100%;
  min-height: 58px;
  background: linear-gradient(115deg, #ffffff 0%, #ffffff 44%, #1aa3b8 44.2%, #1597ab 100%);
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  line-height: 1.2;
  border-bottom: 1px solid #eaeaea;
}

.banner-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-cube {
  font-size: 24px;
  color: #ff5722;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  color: #1f2421;
  letter-spacing: -0.5px;
}

.brand-name small {
  font-size: 11px;
  font-weight: 600;
  color: #333;
}

.banner-right {
  text-align: right;
  color: #ffffff;
}

.contact-email {
  font-size: 13px;
  font-weight: 500;
}

.contact-phone {
  font-size: 12px;
  font-weight: 400;
  margin-top: 2px;
}

/* ==========================================================================
   Barra "× Cerrar" y Cuerpo
   ========================================================================== */
.close-bar {
  display: flex;
  justify-content: flex-end;
  padding: 8px 18px 0 18px;
}

.btn-close-custom {
  background: transparent;
  border: none;
  color: #6d8598;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}

.btn-close-custom:hover {
  color: #3b5163;
}

.close-icon {
  font-size: 15px;
  line-height: 1;
  font-weight: 700;
}

.window-body {
  padding: 2px 15px 15px 15px;
}

.window-title {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: #333333;
  margin: 6px 0 18px 0;
  letter-spacing: 0.3px;
}

/* ==========================================================================
   Sección de Búsqueda (Formulario Superior)
   ========================================================================== */
.search-card {
  border: 1px solid #dcdcdc;
  border-radius: 8px;
  padding: 18px 22px 20px 22px;
  margin-bottom: 22px;
  background-color: #ffffff;
}

.form-label-custom {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #2b2b2b;
  margin-bottom: 4px;
}

.form-control-underline {
  width: 100%;
  border: none;
  border-bottom: 1px solid #cccccc;
  border-radius: 0;
  padding: 5px 0 6px 0;
  font-size: 14px;
  color: #555555;
  background-color: transparent;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-control-underline:focus {
  border-bottom-color: #00897b;
}

/* Estilo del Select con flecha derecha */
.select-wrapper {
  position: relative;
}

.form-select-underline {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 24px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333333' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  background-size: 13px;
}

/* ==========================================================================
   Botones Teal (Buscar y Descarga PDF)
   ========================================================================== */
.btn-teal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #00897b;
  color: #ffffff;
  border: none;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.16);
}

.btn-teal:hover,
.btn-teal:focus {
  background-color: #00695c;
  color: #ffffff;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.22);
}

.btn-search {
  font-size: 14px;
  padding: 8px 18px;
  border-radius: 4px;
}

/* ==========================================================================
   Sección de Información del Certificado (Caja Inferior)
   ========================================================================== */
.info-card {
  border: 1px solid #dcdcdc;
  border-radius: 3px;
  padding: 18px 20px 22px 20px;
  background-color: #ffffff;
}

.info-title {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: #54728c;
  margin: 0 0 12px 0;
}

/* Barra verde de estado */
.status-badge {
  width: 100%;
  border-radius: 50px;
  padding: 6px 14px;
  text-align: center;
  font-size: 13.5px;
  color: #ffffff;
  margin-bottom: 18px;
}

.status-vigente {
  background-color: #4caf50;
}

.status-subtext {
  font-style: italic;
  font-weight: 350;
  margin-left: 3px;
}

/* Lista de detalles */
.cert-details {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}

.detail-item {
  line-height: 1.4;
}

.detail-label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: #222222;
}

.detail-value {
  display: block;
  font-size: 13.5px;
  font-weight: 400;
  color: #444444;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Botones PDF inferiores */
.pdf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-pdf {
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 4px;
}

/* ==========================================================================
   Media Queries (Responsividad para Celulares, Tablets y PC)
   ========================================================================== */

/* Pantallas de PC grandes */
@media (min-width: 900px) {
  .page-wrapper {
    padding: 36px 20px;
  }

  .cert-window {
    max-width: 630px;
  }
}

/* Tablets y pantallas medianas */
@media (min-width: 576px) and (max-width: 767.98px) {
  .cert-window {
    max-width: 560px;
  }
}

/* Celulares pequeños y medianos (< 576px) */
@media (max-width: 575.98px) {
  .page-wrapper {
    padding: 12px 8px;
  }

  .window-body {
    padding: 4px 12px 16px 12px;
  }

  .window-title {
    font-size: 16px;
    margin-bottom: 14px;
  }

  .search-card,
  .info-card {
    padding: 14px;
  }

  .info-title {
    font-size: 14.5px;
  }

  .status-badge,
  .detail-label,
  .detail-value,
  .btn-pdf {
    font-size: 12.5px;
  }

  /* Evita zoom automático en iOS al enfocar inputs sin alterar el diseño */
  .form-control-underline {
    font-size: 14px;
  }

  /* Ajuste del placeholder del banner en móviles pequeños */
  .banner-placeholder {
    background: linear-gradient(115deg, #ffffff 0%, #ffffff 48%, #1aa3b8 48.2%, #1597ab 100%);
    padding: 6px 10px;
  }

  .brand-name {
    font-size: 16px;
  }

  .contact-email,
  .contact-phone {
    font-size: 10.5px;
  }
}

/* Celulares muy pequeños (< 380px) */
@media (max-width: 380px) {
  .pdf-actions {
    flex-direction: column;
  }

  .btn-pdf,
  .btn-search {
    width: 100%;
  }
}

