:root {
      /* Paleta Oficial Manual GADM Riobamba 2025 */
      --navy-deep: #223260;         /* Pantone 534 C - Azul Institucional */
      --navy-900: #1a274c;
      --navy-800: #223260;
      --navy-700: #2f447f;
      --navy-subtle: #f0f3fa;
      --riobamba-red: #e83f44;     /* Pantone 710 C - Rojo Riobamba */
      --riobamba-red-hover: #cf2f34;
      --riobamba-red-active: #b32126;
      --riobamba-red-light: #fef2f2;
      --sky-blue: #2ea8e0;         /* Pantone 298 C - Celeste Lema */
      --sky-blue-light: #f0f9ff;
      --sky-blue-border: #bae6fd;
      --success-green: #009145;    /* Pantone 355 C - Verde Aprobación */
      --success-bg: #ecfdf5;
      --success-border: #a7f3d0;
      --warning-amber: #f8af3b;    /* Pantone 143 C - Ámbar / Alerta */
      --warning-bg: #fffbeb;
      --warning-border: #fde68a;
      --purple-accent: #8d2f88;    /* Pantone 513 C */
      --vibrant-blue: #303687;     /* Pantone 7687 C */

      /* Lienzo, Superficies y Bordes */
      --bg: #f7f8fa;
      --surface: #ffffff;
      --surface-elevated: #ffffff;
      --surface-subtle: #f4f6f9;
      --border: #d9dee7;
      --border-subtle: #e5e9f0;
      --border-focus: #2ea8e0;

      /* Tipografía y Textos */
      --text: #223260;
      --text-main: #1e293b;
      --text-muted: #64748b;
      --text-soft: #94a3b8;

      /* Tokens de Layout - 8px Grid */
      --radius-sm: 6px;
      --radius-md: 8px;            /* Estándar institucional */
      --radius-lg: 12px;
      --radius-xl: 16px;
      --shadow-sm: 0 1px 3px rgba(34, 50, 96, 0.05);
      --shadow-md: 0 4px 10px -2px rgba(34, 50, 96, 0.08), 0 2px 4px -1px rgba(34, 50, 96, 0.04);
      --shadow-lg: 0 14px 28px -6px rgba(34, 50, 96, 0.12), 0 6px 12px -3px rgba(34, 50, 96, 0.06);
      --shadow-card: 0 18px 36px -10px rgba(34, 50, 96, 0.09), 0 2px 6px rgba(34, 50, 96, 0.04);
      --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    }

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

    body {
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
      background-color: var(--bg);
      color: var(--text-main);
      line-height: 1.5;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }

    /* Cinta Cromática Institucional Oficial */
    .top-strip {
      display: flex;
      height: 5px;
      width: 100%;
      background: linear-gradient(
        90deg,
        var(--navy-deep) 0%,
        var(--navy-deep) 35%,
        var(--riobamba-red) 35%,
        var(--riobamba-red) 60%,
        var(--sky-blue) 60%,
        var(--sky-blue) 78%,
        var(--success-green) 78%,
        var(--success-green) 90%,
        var(--warning-amber) 90%,
        var(--warning-amber) 100%
      );
    }

    /* Cabecera Institucional */
    header.header {
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      position: sticky;
      top: 0;
      z-index: 40;
      backdrop-filter: blur(10px);
      background-color: rgba(255, 255, 255, 0.96);
      box-shadow: 0 1px 3px rgba(34, 50, 96, 0.03);
    }

    .header-container {
      max-width: 1180px;
      margin: 0 auto;
      padding: 12px 24px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
    }

    .brand-group {
      display: flex;
      align-items: center;
      gap: 16px;
      text-decoration: none;
      color: inherit;
    }

    .brand-logo-img {
      height: 48px;
      width: auto;
      max-width: 220px;
      object-fit: contain;
      display: block;
    }

    .header-divider {
      width: 1px;
      height: 32px;
      background-color: var(--border);
    }

    .header-dept {
      display: flex;
      flex-direction: column;
    }

    .header-dept-title {
      font-size: 13px;
      font-weight: 700;
      color: var(--navy-deep);
      line-height: 1.2;
    }

    .header-dept-sub {
      font-size: 11px;
      font-weight: 600;
      color: var(--riobamba-red);
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }

    .header-badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: var(--sky-blue-light);
      border: 1px solid var(--sky-blue-border);
      color: var(--navy-deep);
      padding: 6px 14px;
      border-radius: 9999px;
      font-size: 12px;
      font-weight: 600;
      box-shadow: 0 1px 2px rgba(34, 50, 96, 0.04);
    }

    .badge-dot {
      width: 8px;
      height: 8px;
      background: var(--success-green);
      border-radius: 50%;
      box-shadow: 0 0 0 2px rgba(0, 145, 69, 0.25);
      animation: pulseGreen 2s infinite ease-in-out;
    }

    @keyframes pulseGreen {
      0%, 100% { transform: scale(1); opacity: 1; }
      50% { transform: scale(1.2); opacity: 0.75; }
    }

    /* Main Container */
    main.main {
      flex: 1;
      display: flex;
      flex-direction: column;
      position: relative;
      overflow: hidden;
    }

    .hero-bg-accent {
      position: absolute;
      top: 0;
      left: 50%;
      transform: translateX(-50%);
      width: 100%;
      max-width: 1280px;
      height: 480px;
      background: radial-gradient(circle at 50% 0%, rgba(46, 168, 224, 0.09) 0%, rgba(34, 50, 96, 0.03) 50%, transparent 80%);
      pointer-events: none;
      z-index: 0;
    }

    .content-wrap {
      max-width: 880px;
      margin: 0 auto;
      padding: 40px 20px 64px;
      width: 100%;
      position: relative;
      z-index: 1;
    }

    /* Hero Section */
    .hero-section {
      text-align: center;
      margin-bottom: 34px;
    }

    .hero-tag {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: var(--navy-subtle);
      border: 1px solid rgba(34, 50, 96, 0.12);
      color: var(--navy-deep);
      padding: 5px 14px;
      border-radius: 9999px;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      margin-bottom: 16px;
    }

    .hero-tag svg {
      color: var(--riobamba-red);
    }

    .hero-title {
      font-family: 'Montserrat', 'Inter', sans-serif;
      font-size: 36px;
      font-weight: 800;
      color: var(--navy-deep);
      letter-spacing: -0.025em;
      line-height: 1.16;
      margin-bottom: 12px;
    }

    .hero-subtitle {
      font-size: 16px;
      font-weight: 500;
      color: #334155;
      max-width: 740px;
      margin: 0 auto 18px;
      line-height: 1.5;
    }

    .hero-meta {
      display: inline-flex;
      align-items: center;
      gap: 18px;
      flex-wrap: wrap;
      justify-content: center;
      font-size: 13px;
      color: var(--text-muted);
    }

    .meta-item {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: var(--surface);
      border: 1px solid var(--border);
      padding: 4px 12px;
      border-radius: 9999px;
      box-shadow: var(--shadow-sm);
    }

    .meta-item svg {
      color: var(--sky-blue);
    }

    /* Tarjeta Principal de Consulta */
    .card-consult {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 32px 36px;
      box-shadow: var(--shadow-card);
      margin-bottom: 32px;
      transition: var(--transition);
      position: relative;
    }

    .card-consult::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 4px;
      background: linear-gradient(90deg, var(--navy-deep), var(--riobamba-red), var(--sky-blue));
      border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .form-group {
      margin-bottom: 22px;
    }

    .form-label {
      display: block;
      font-size: 14px;
      font-weight: 700;
      color: var(--navy-deep);
      margin-bottom: 8px;
    }

    .input-wrapper {
      position: relative;
      display: flex;
      align-items: center;
    }

    .input-icon {
      position: absolute;
      left: 16px;
      color: var(--navy-deep);
      opacity: 0.6;
      pointer-events: none;
      display: flex;
      align-items: center;
    }

    .form-input {
      width: 100%;
      height: 52px;
      padding: 10px 16px 10px 48px;
      font-size: 16px;
      font-family: inherit;
      font-weight: 500;
      color: var(--navy-deep);
      background-color: #fafbfc;
      border: 1.5px solid var(--border);
      border-radius: var(--radius-md);
      outline: none;
      transition: var(--transition);
      letter-spacing: 0.03em;
    }

    .form-input:focus {
      background-color: #ffffff;
      border-color: var(--navy-deep);
      box-shadow: 0 0 0 3.5px rgba(34, 50, 96, 0.12);
    }

    .form-help {
      font-size: 12px;
      color: var(--text-muted);
      margin-top: 10px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
    }

    .demo-pills {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
      font-size: 11px;
    }

    .demo-pill-btn {
      background: var(--surface-subtle);
      border: 1px solid var(--border);
      color: var(--navy-deep);
      font-weight: 600;
      padding: 3px 9px;
      border-radius: var(--radius-sm);
      font-size: 11px;
      font-family: inherit;
      cursor: pointer;
      transition: var(--transition);
    }

    .demo-pill-btn:hover {
      background: var(--navy-subtle);
      color: var(--navy-deep);
      border-color: var(--sky-blue);
    }

    /* Botón CTA Primario en Rojo Riobamba */
    .btn-submit {
      width: 100%;
      height: 52px;
      background: var(--riobamba-red);
      color: #ffffff;
      border: none;
      border-radius: var(--radius-md);
      font-size: 15px;
      font-weight: 700;
      font-family: inherit;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      cursor: pointer;
      box-shadow: 0 4px 14px rgba(232, 63, 68, 0.32);
      transition: var(--transition);
      letter-spacing: 0.01em;
    }

    .btn-submit:hover {
      background: var(--riobamba-red-hover);
      box-shadow: 0 6px 18px rgba(232, 63, 68, 0.42);
      transform: translateY(-1px);
    }

    .btn-submit:active {
      background: var(--riobamba-red-active);
      transform: translateY(0);
    }

    /* Estados de la Interfaz */
    .state-panel {
      display: none;
      animation: fadeIn 0.25s ease-out forwards;
    }

    .state-panel.active {
      display: block;
    }

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

    /* Estado 1: Inicial (Guía de 3 pasos) */
    .init-steps {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 16px;
      margin-top: 10px;
    }

    @media (max-width: 680px) {
      .init-steps {
        grid-template-columns: 1fr;
      }
    }

    .step-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 18px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      box-shadow: var(--shadow-sm);
    }

    .step-num {
      width: 28px;
      height: 28px;
      background: var(--navy-subtle);
      color: var(--navy-deep);
      border: 1px solid rgba(34, 50, 96, 0.15);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      font-weight: 800;
    }

    .step-title {
      font-size: 14px;
      font-weight: 700;
      color: var(--navy-deep);
    }

    .step-desc {
      font-size: 12px;
      color: var(--text-muted);
      line-height: 1.45;
    }

    /* Estado 2: Success Card (Encontrado) */
    .card-success {
      background: var(--surface);
      border: 1.5px solid var(--success-border);
      border-radius: var(--radius-lg);
      overflow: hidden;
      box-shadow: var(--shadow-lg);
    }

    .success-header-banner {
      background: var(--success-bg);
      border-bottom: 1px solid var(--success-border);
      padding: 18px 26px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      flex-wrap: wrap;
    }

    .success-badge-group {
      display: flex;
      align-items: center;
      gap: 14px;
    }

    .success-icon-box {
      width: 42px;
      height: 42px;
      background: var(--success-green);
      color: #ffffff;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 3px 8px rgba(0, 145, 69, 0.35);
      flex-shrink: 0;
    }

    .success-title-text {
      font-size: 16px;
      font-weight: 800;
      color: #065f46;
      line-height: 1.2;
    }

    .success-sub-text {
      font-size: 12px;
      color: #047857;
    }

    .role-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: var(--navy-subtle);
      border: 1px solid rgba(34, 50, 96, 0.15);
      color: var(--navy-deep);
      padding: 5px 12px;
      border-radius: 9999px;
      font-size: 12px;
      font-weight: 700;
      width: fit-content;
    }

    .role-badge.ponente {
      background: var(--sky-blue-light);
      border-color: var(--sky-blue-border);
      color: #0284c7;
    }

    .success-body {
      padding: 28px 32px;
    }

    .participant-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 16px 24px;
      margin-bottom: 24px;
      background: var(--surface-subtle);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 20px;
    }

    @media (max-width: 640px) {
      .participant-grid {
        grid-template-columns: 1fr;
      }
    }

    .info-cell {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .info-label {
      font-size: 11px;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .info-value {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-main);
    }

    .info-value.highlight {
      font-size: 17px;
      font-weight: 800;
      color: var(--navy-deep);
    }

    /* Miniatura interactiva del certificado */
    .certificate-mini-preview-card {
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 18px;
      background: #fafbfc;
      margin-bottom: 24px;
      display: flex;
      align-items: center;
      gap: 20px;
      flex-wrap: wrap;
    }

    .mini-cert-frame {
      width: 105px;
      height: 148px;
      background: #ffffff;
      background-image: url('../assets/certificado_oficial_web.png');
      background-size: 100% 100%;
      border: 1px solid #cbd5e1;
      border-radius: var(--radius-sm);
      box-shadow: var(--shadow-sm);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 0;
      position: relative;
      cursor: pointer;
      transition: var(--transition);
      flex-shrink: 0;
      overflow: hidden;
    }

    .mini-cert-frame:hover {
      border-color: var(--sky-blue);
      box-shadow: 0 6px 18px rgba(46, 168, 224, 0.3);
      transform: scale(1.04);
    }

    .mini-cert-inner-border {
      display: none;
    }

    .mini-cert-inner-border::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 2px;
      background: linear-gradient(90deg, var(--navy-deep), var(--riobamba-red));
    }

    .mini-cert-title {
      font-size: 7px;
      font-weight: 800;
      color: var(--navy-deep);
      text-transform: uppercase;
      letter-spacing: 0.06em;
    }

    .mini-cert-name {
      font-size: 8px;
      font-weight: 700;
      color: var(--navy-deep);
      line-height: 1.1;
      max-width: 90%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .mini-cert-bottom {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      padding: 0 4px;
    }

    .mini-qr {
      width: 18px;
      height: 18px;
      background: #223260;
      mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3h8v8H3zm2 2v4h4V5zm8-2h8v8h-8zm2 2v4h4V5zM3 13h8v8H3zm2 2v4h4v-4zm13-2h3v2h-3zm-5 0h3v3h-3zm2 3h3v3h-3zm3 0h3v5h-2v-3h-1zm-5 2h2v3h-2zm-2-2h2v2h-2z'/%3E%3C/svg%3E") no-repeat center / contain;
      -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3h8v8H3zm2 2v4h4V5zm8-2h8v8h-8zm2 2v4h4V5zM3 13h8v8H3zm2 2v4h4v-4zm13-2h3v2h-3zm-5 0h3v3h-3zm2 3h3v3h-3zm3 0h3v5h-2v-3h-1zm-5 2h2v3h-2zm-2-2h2v2h-2z'/%3E%3C/svg%3E") no-repeat center / contain;
    }

    .mini-seal {
      width: 16px;
      height: 16px;
      background: var(--riobamba-red);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #ffffff;
      font-size: 7px;
      font-weight: 700;
    }

    .mini-cert-copy {
      flex: 1;
      min-width: 220px;
    }

    .mini-cert-copy-title {
      font-size: 14px;
      font-weight: 700;
      color: var(--navy-deep);
      margin-bottom: 4px;
    }

    .mini-cert-copy-desc {
      font-size: 12px;
      color: var(--text-muted);
      line-height: 1.45;
      margin-bottom: 8px;
    }

    .card-actions-bar {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }

    .btn-download-pdf {
      flex: 1;
      min-width: 220px;
      height: 48px;
      background: var(--success-green);
      color: #ffffff;
      border: none;
      border-radius: var(--radius-md);
      font-size: 14px;
      font-weight: 700;
      font-family: inherit;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      cursor: pointer;
      box-shadow: 0 4px 12px rgba(0, 145, 69, 0.28);
      transition: var(--transition);
      text-decoration: none;
    }

    .btn-download-pdf:hover {
      background: #007738;
      box-shadow: 0 6px 16px rgba(0, 145, 69, 0.38);
      transform: translateY(-1px);
    }

    .btn-preview-modal {
      height: 48px;
      background: var(--surface);
      color: var(--navy-deep);
      border: 1.5px solid var(--border);
      border-radius: var(--radius-md);
      padding: 0 20px;
      font-size: 14px;
      font-weight: 700;
      font-family: inherit;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      cursor: pointer;
      transition: var(--transition);
    }

    .btn-preview-modal:hover {
      background: var(--navy-subtle);
      border-color: var(--navy-deep);
    }

    .btn-reset-search {
      height: 48px;
      background: transparent;
      color: var(--text-muted);
      border: 1px dashed var(--border);
      border-radius: var(--radius-md);
      padding: 0 16px;
      font-size: 13px;
      font-weight: 600;
      font-family: inherit;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      cursor: pointer;
      transition: var(--transition);
    }

    .btn-reset-search:hover {
      background: var(--surface-subtle);
      color: var(--navy-deep);
      border-color: var(--text-muted);
    }

    /* Estado 3: Not Found State (No Encontrado) */
    .card-not-found {
      background: var(--surface);
      border: 1.5px solid var(--warning-border);
      border-radius: var(--radius-lg);
      padding: 36px 32px;
      box-shadow: var(--shadow-card);
      text-align: center;
    }

    .not-found-icon-box {
      width: 58px;
      height: 58px;
      background: var(--warning-bg);
      border: 1.5px solid var(--warning-border);
      color: #b45309;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 16px;
    }

    .not-found-title {
      font-size: 19px;
      font-weight: 800;
      color: var(--navy-deep);
      margin-bottom: 8px;
    }

    .not-found-desc {
      font-size: 14px;
      color: var(--text-muted);
      max-width: 580px;
      margin: 0 auto 20px;
      line-height: 1.55;
    }

    .not-found-tips {
      background: #fafbfc;
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 16px 20px;
      max-width: 560px;
      margin: 0 auto 24px;
      text-align: left;
      font-size: 13px;
    }

    .not-found-tips-title {
      font-weight: 700;
      margin-bottom: 8px;
      color: var(--navy-deep);
    }

    .not-found-tips ul {
      padding-left: 20px;
      color: var(--text-muted);
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .not-found-actions {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      flex-wrap: wrap;
    }

    .btn-support {
      height: 46px;
      background: var(--navy-deep);
      color: #ffffff;
      border: none;
      border-radius: var(--radius-md);
      padding: 0 22px;
      font-size: 13px;
      font-weight: 700;
      font-family: inherit;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
      transition: var(--transition);
      box-shadow: 0 4px 10px rgba(34, 50, 96, 0.2);
    }

    .btn-support:hover {
      background: var(--navy-900);
      box-shadow: 0 6px 14px rgba(34, 50, 96, 0.28);
    }

    /* Modal de Previsualización y Certificado Oficial (Página 19 del Manual) */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(34, 50, 96, 0.7);
      backdrop-filter: blur(5px);
      z-index: 100;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
      opacity: 0;
      transition: opacity 0.2s ease;
    }

    .modal-overlay.open {
      display: flex;
      opacity: 1;
    }

    .modal-container {
      background: #ffffff;
      border-radius: var(--radius-lg);
      max-width: 960px;
      width: 100%;
      max-height: 92vh;
      overflow-y: auto;
      box-shadow: 0 25px 50px -12px rgba(34, 50, 96, 0.35);
      position: relative;
      display: flex;
      flex-direction: column;
    }

    .modal-header {
      padding: 16px 24px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: #fafbfc;
      border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .modal-title {
      font-size: 15px;
      font-weight: 700;
      color: var(--navy-deep);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .btn-close-modal {
      background: transparent;
      border: none;
      font-size: 22px;
      color: var(--text-muted);
      cursor: pointer;
      width: 32px;
      height: 32px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: var(--transition);
    }

    .btn-close-modal:hover {
      background: var(--navy-subtle);
      color: var(--navy-deep);
    }

    .modal-body {
      padding: 28px;
      background: #eef2f6;
      display: flex;
      justify-content: center;
    }

    /* ==========================================================================
       Modelo de Certificado Oficial — Vertical A4 Oficial GADM Riobamba 2026
       ========================================================================== */
    .diploma-canvas {
      width: 100%;
      max-width: 680px;
      aspect-ratio: 595.28 / 841.89;
      container-type: inline-size;
      container-name: certificate;
      background-color: #ffffff;
      background-image: url('../assets/certificado_oficial_web.png');
      background-size: 100% 100%;
      background-repeat: no-repeat;
      position: relative;
      box-shadow: 0 16px 40px rgba(34, 50, 96, 0.16);
      border-radius: 4px;
      overflow: hidden;
      margin: 0 auto;
      user-select: text;
    }

    /* Zona Dinámica del Recipiente del Certificado */
    .diploma-recipient-container {
      position: absolute;
      top: 36.0%;
      left: 8.1%;
      width: 61.8%;
      height: 8.2%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      box-sizing: border-box;
      padding: 0 4px;
      z-index: 2;
    }

    .diploma-recipient-name {
      font-family: 'Montserrat', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
      font-weight: 800;
      color: #223260;
      text-transform: uppercase;
      letter-spacing: -0.01em;
      line-height: 1.15;
      font-size: clamp(10px, 3.3cqi, 22px);
      max-width: 100%;
      word-break: break-word;
    }

    .diploma-recipient-id {
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
      font-weight: 600;
      font-size: clamp(7.5px, 1.8cqi, 12px);
      color: #64748b;
      letter-spacing: 0.05em;
      margin-top: 2px;
    }

    /* Sello Oficial de Seguridad y Validación QR */
    .diploma-security-seal {
      position: absolute;
      bottom: 2.4%;
      left: 8.1%;
      width: 61.8%;
      height: 7.2%;
      display: flex;
      align-items: center;
      gap: 12px;
      box-sizing: border-box;
      z-index: 2;
    }

    .diploma-qr-frame {
      width: clamp(42px, 5.2vw, 56px);
      height: clamp(42px, 5.2vw, 56px);
      background: #ffffff;
      padding: 3px;
      border-radius: 4px;
      border: 1px solid rgba(34, 50, 96, 0.2);
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .diploma-qr-image {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
    }

    .diploma-security-info {
      display: flex;
      flex-direction: column;
      justify-content: center;
      line-height: 1.25;
      color: #334155;
    }

    .sec-label {
      font-size: clamp(8px, 0.95vw, 10px);
      font-weight: 800;
      color: #223260;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .sec-label svg {
      color: #009145;
      flex-shrink: 0;
    }

    .sec-cuv {
      font-size: clamp(9px, 1.1vw, 11px);
      font-family: monospace;
      font-weight: 700;
      color: #e83f44;
      letter-spacing: 0.03em;
      margin: 1px 0;
    }

    .sec-caption {
      font-size: clamp(7px, 0.85vw, 9px);
      color: #64748b;
      line-height: 1.2;
    }

    .modal-footer {
      padding: 14px 24px;
      border-top: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 12px;
      background: #fafbfc;
      border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }

    /* Modal Soporte TICs */
    .support-card-link {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 14px;
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      text-decoration: none;
      color: inherit;
      background: var(--surface-subtle);
      transition: var(--transition);
    }

    .support-card-link:hover {
      background: var(--navy-subtle);
      border-color: var(--navy-deep);
    }

    /* Pie de Página Institucional */
    footer.footer {
      background: var(--surface);
      border-top: 1px solid var(--border);
      margin-top: auto;
      padding: 36px 20px 24px;
      font-size: 13px;
      color: var(--text-muted);
    }

    .footer-container {
      max-width: 1180px;
      margin: 0 auto;
      display: flex;
      flex-direction: column;
      gap: 22px;
    }

    .footer-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
      flex-wrap: wrap;
    }

    .footer-brand {
      display: flex;
      align-items: center;
      gap: 14px;
    }

    .footer-logo-img {
      height: 38px;
      width: auto;
      object-fit: contain;
    }

    .footer-brand-text {
      display: flex;
      flex-direction: column;
    }

    .footer-brand-title {
      font-weight: 700;
      color: var(--navy-deep);
      font-size: 13px;
    }

    .footer-brand-slogan {
      font-size: 11px;
      color: var(--riobamba-red);
      font-weight: 600;
    }

    .footer-links {
      display: flex;
      align-items: center;
      gap: 22px;
      flex-wrap: wrap;
    }

    .footer-link {
      color: var(--text-muted);
      text-decoration: none;
      transition: var(--transition);
      font-size: 13px;
      font-weight: 500;
    }

    .footer-link:hover {
      color: var(--navy-deep);
    }

    .footer-bottom {
      border-top: 1px solid var(--border);
      padding-top: 18px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      flex-wrap: wrap;
      font-size: 12px;
    }

    .loading-spinner {
      display: inline-block;
      width: 18px;
      height: 18px;
      border: 2.5px solid rgba(255, 255, 255, 0.3);
      border-radius: 50%;
      border-top-color: #ffffff;
      animation: spin 0.75s linear infinite;
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    /* ==========================================================================
       Auditoría y Reglas Responsivas Globales (Mobile, Tablet, Desktop)
       ========================================================================== */

    /* Tablets y Pantallas Medianas (<= 768px) */
    @media (max-width: 768px) {
      .content-wrap {
        padding: 28px 16px 48px;
      }

      .admin-grid {
        grid-template-columns: 1fr !important;
      }

      .init-steps {
        grid-template-columns: 1fr;
        gap: 12px;
      }
    }

    /* Móviles Estándar (<= 640px) */
    @media (max-width: 640px) {
      .header-container {
        padding: 10px 16px;
        gap: 10px;
      }

      .brand-group {
        gap: 10px;
      }

      .brand-logo-img {
        height: 38px;
        max-width: 170px;
      }

      .header-dept-title {
        font-size: 12px;
      }

      .header-dept-sub {
        font-size: 10px;
      }

      .header-badge {
        padding: 4px 10px;
        font-size: 11px;
      }

      .hero-section {
        margin-bottom: 22px;
      }

      .hero-title {
        font-size: clamp(22px, 5.5vw, 28px);
        margin-bottom: 8px;
      }

      .hero-subtitle {
        font-size: 14px;
        line-height: 1.45;
        margin-bottom: 14px;
      }

      .card-consult {
        padding: 22px 18px;
        margin-bottom: 22px;
      }

      .form-input {
        height: 48px;
        font-size: 16px; /* Evita auto-zoom en iOS Safari */
      }

      .btn-submit {
        height: 48px;
        font-size: 14.5px;
      }

      .success-header-banner {
        padding: 14px 16px;
      }

      .success-title-text {
        font-size: 15px;
      }

      .success-body {
        padding: 18px 16px;
      }

      .participant-grid {
        grid-template-columns: 1fr;
        padding: 14px;
        gap: 12px;
        margin-bottom: 18px;
      }

      .info-value.highlight {
        font-size: 15.5px;
      }

      .certificate-mini-preview-card {
        padding: 14px;
        gap: 14px;
      }

      .btn-download-pdf {
        width: 100%;
        max-width: 100% !important;
        height: 48px;
        font-size: 14px;
      }

      .card-not-found {
        padding: 26px 18px;
      }

      .footer-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
      }

      .footer-brand {
        flex-direction: column;
        text-align: center;
        gap: 8px;
      }

      .footer-links {
        justify-content: center;
        gap: 14px;
      }

      .footer-bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
      }
    }

    /* Móviles Pequeños (<= 480px) */
    @media (max-width: 480px) {
      .content-wrap {
        padding: 20px 12px 36px;
      }

      .header-divider {
        display: none;
      }

      .header-badge {
        display: none;
      }

      .card-consult {
        padding: 18px 14px;
      }

      .certificate-mini-preview-card {
        flex-direction: column;
        text-align: center;
        align-items: center;
      }

      .mini-cert-frame {
        margin: 0 auto;
      }

      .mini-cert-copy {
        min-width: 0;
        width: 100%;
        text-align: center;
      }

      .modal-body {
        padding: 12px 8px;
      }
    }

    /* Estilos de Impresión Oficial — Formato A4 Vertical Institucional */
    @media print {
      @page {
        size: A4 portrait;
        margin: 0;
      }

      html, body {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 210mm !important;
        height: 297mm !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
      }

      body * {
        visibility: hidden !important;
      }

      #diplomaPrintArea, #diplomaPrintArea * {
        visibility: visible !important;
      }

      #diplomaPrintArea {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 210mm !important;
        height: 297mm !important;
        max-width: none !important;
        aspect-ratio: auto !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background-image: url('../assets/certificado_oficial_print.png') !important;
        background-size: 100% 100% !important;
        page-break-inside: avoid !important;
        page-break-after: avoid !important;
      }

      .diploma-recipient-name {
        font-size: 20pt !important;
      }

      .diploma-recipient-id {
        font-size: 10.5pt !important;
      }
    }
