/* ==========================================================================
   ESTILOS GENERALES Y DISEÑO FLUENT - SIMULADOR WINDOWS 11
   ABC Training - Elaborado por Lic. Victor Elias Sellis Zeballos
   ========================================================================== */

:root {
    --win11-bg-blur: rgba(243, 243, 243, 0.78);
    --win11-bg-dark-blur: rgba(32, 32, 32, 0.84);
    --win11-border: rgba(0, 0, 0, 0.08);
    --win11-border-dark: rgba(255, 255, 255, 0.08);
    --win11-accent: #0067c0;
    --win11-accent-hover: #1879cd;
    --win11-text: #1b1b1b;
    --win11-text-secondary: #5d5d5d;
    --win11-text-dark: #f0f0f0;
    --win11-text-dark-secondary: #a0a0a0;
    --win11-radius: 8px;
    --win11-radius-lg: 12px;
    --win11-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
    --win11-taskbar-height: 48px;
    --font-fluent: "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

html, body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: var(--font-fluent);
    background-color: #000;
    color: var(--win11-text);
}

body.dark-theme {
    color: var(--win11-text-dark);
}

/* ==========================================================================
   CARÁTULA INSTITUCIONAL / BIENVENIDA ABC TRAINING
   ========================================================================== */
#cover-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 50%, rgba(13, 37, 74, 0.85) 0%, rgba(5, 12, 28, 0.95) 100%),
                url('../assets/wallpaper.jpg') center/cover no-repeat;
    backdrop-filter: blur(25px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#cover-screen.fade-out {
    opacity: 0;
    transform: scale(1.04);
    pointer-events: none;
}

.cover-card {
    width: 90%;
    max-width: 580px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 38px 42px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(30px);
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: fadeInScale 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.dark-theme .cover-card {
    background: rgba(30, 34, 45, 0.92);
    border-color: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.cover-header {
    margin-bottom: 24px;
}

.cover-logo-img {
    height: 70px;
    max-width: 240px;
    object-fit: contain;
    margin-bottom: 14px;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.1));
}

.cover-institution-badge {
    display: inline-block;
    background: #e5f1fb;
    color: #005fb8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 4px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    margin-bottom: 12px;
    border: 1px solid rgba(0, 95, 184, 0.2);
}

.cover-title {
    font-size: 26px;
    font-weight: 700;
    color: #0f2744;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    line-height: 1.25;
}

.dark-theme .cover-title {
    color: #e2eeff;
}

.cover-credits-box {
    background: rgba(0, 103, 192, 0.05);
    border-left: 3px solid #0067c0;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 24px;
    text-align: left;
    font-size: 13px;
    color: #333;
}

.dark-theme .cover-credits-box {
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
}

.cover-credits-line {
    margin-bottom: 3px;
}

.cover-credits-line strong {
    color: #005fb8;
}

.dark-theme .cover-credits-line strong {
    color: #4cc2ff;
}

.student-form-group {
    text-align: left;
    margin-bottom: 16px;
}

.student-form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #444;
}

.dark-theme .student-form-label {
    color: #bbb;
}

.student-input {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s;
    background: #fff;
    color: #111;
}

.student-input:focus {
    border-color: #0067c0;
    box-shadow: 0 0 0 3px rgba(0, 103, 192, 0.15);
}

.dark-theme .student-input {
    background: #232733;
    border-color: #3f475a;
    color: #fff;
}

.btn-primary-large {
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, #0067c0 0%, #00529b 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 103, 192, 0.35);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.btn-primary-large:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 103, 192, 0.45);
    background: linear-gradient(135deg, #1075d1 0%, #005ea8 100%);
}

.existing-student-card {
    background: #f0f7ff;
    border: 1px solid #c2e0ff;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.dark-theme .existing-student-card {
    background: rgba(0, 95, 184, 0.15);
    border-color: rgba(76, 194, 255, 0.25);
}

.existing-welcome {
    font-size: 16px;
    font-weight: 700;
    color: #005fb8;
    margin-bottom: 6px;
}

.dark-theme .existing-welcome {
    color: #60cdff;
}

.existing-progress-pill {
    display: inline-block;
    background: #28a745;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.btn-secondary-link {
    background: transparent;
    border: none;
    color: #666;
    font-size: 12.5px;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 10px;
    display: inline-block;
}

.dark-theme .btn-secondary-link {
    color: #aaa;
}

/* ==========================================================================
   TUTOR HUD (ARRASTRABLE Y MINIMIZABLE - SIN COLISIÓN CON MENÚ INICIO)
   Por defecto ubicado en la esquina superior derecha
   ========================================================================== */
#tutor-hud {
    position: fixed;
    top: 16px;
    right: 24px;
    left: auto;
    width: auto;
    min-width: 380px;
    max-width: 520px;
    background: var(--win11-bg-blur);
    border: 1px solid var(--win11-border);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    z-index: 9999;
    padding: 10px 14px;
    transition: box-shadow 0.2s, background 0.2s;
    user-select: none;
}

.dark-theme #tutor-hud {
    background: var(--win11-bg-dark-blur);
    border-color: var(--win11-border-dark);
}

.hud-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
    padding-bottom: 6px;
}

.hud-top-bar:active {
    cursor: grabbing;
}

.hud-student-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.hud-drag-icon {
    font-size: 14px;
    color: #888;
    margin-right: 2px;
}

.hud-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0067c0;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 10px;
}

.hud-student-name {
    font-weight: 700;
    color: var(--win11-accent);
}

.hud-controls-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hud-module-select {
    padding: 3px 6px;
    font-size: 11px;
    font-family: inherit;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    outline: none;
    max-width: 140px;
}

.dark-theme .hud-module-select {
    background: #2b2b2b;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
}

.hud-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 103, 192, 0.1);
    color: #0067c0;
    border: 1px solid rgba(0, 103, 192, 0.2);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.hud-btn-action:hover {
    background: rgba(0, 103, 192, 0.2);
}

.dark-theme .hud-btn-action {
    background: rgba(76, 194, 255, 0.15);
    color: #60cdff;
    border-color: rgba(76, 194, 255, 0.3);
}

.hud-btn-eval {
    background: #7c4dff;
    color: #fff;
    border-color: #7c4dff;
}

.hud-btn-eval:hover {
    background: #651fff;
}

.hud-btn-cert {
    background: #107c41;
    color: #fff;
    border-color: #107c41;
}

.hud-btn-cert:hover {
    background: #0b5c30;
}

/* Botón Minimizar / Colapsar */
.hud-toggle-btn {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.05);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: inherit;
    transition: background 0.15s;
}

.hud-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.15);
}

.dark-theme .hud-toggle-btn {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

#tutor-hud.collapsed {
    padding-bottom: 8px;
}

#tutor-hud.collapsed #hud-expanded-body {
    display: none !important;
}

#hud-expanded-body {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 8px;
    margin-top: 4px;
}

.dark-theme #hud-expanded-body {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.hud-instruction-box {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.hud-step-badge {
    background: var(--win11-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    margin-top: 2px;
}

.hud-instruction-content {
    flex: 1;
}

.hud-instruction-title {
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 2px;
}

.hud-instruction-text {
    font-size: 12px;
    color: var(--win11-text);
    line-height: 1.35;
}

.dark-theme .hud-instruction-text {
    color: var(--win11-text-dark);
}

.hud-progress-container {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hud-progress-bar {
    flex: 1;
    height: 5px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.dark-theme .hud-progress-bar {
    background: rgba(255, 255, 255, 0.1);
}

.hud-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0067c0, #107c41);
    transition: width 0.4s ease;
}

.hud-progress-pct {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--win11-text-secondary);
}

.dark-theme .hud-progress-pct {
    color: var(--win11-text-dark-secondary);
}

.hud-feedback {
    background: #dff6dd;
    border-left: 3px solid #107c41;
    color: #107c41;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 4px;
    margin-top: 6px;
    display: none;
}

.dark-theme .hud-feedback {
    background: rgba(16, 124, 65, 0.25);
    color: #72d99d;
}

.hud-feedback.hud-feedback-error {
    background: #fde7e9;
    border-left: 3px solid #d13438;
    color: #d13438;
}

.dark-theme .hud-feedback.hud-feedback-error {
    background: rgba(209, 52, 56, 0.25);
    color: #ff99a4;
}

.dark-theme .taskmanager-view {
    background: #202020 !important;
    color: #fff;
}

.dark-theme .perf-card {
    background: rgba(255, 255, 255, 0.05) !important;
}

.dark-theme .perf-card.active {
    background: rgba(0, 103, 192, 0.3) !important;
}

/* ==========================================================================
   SISTEMA DE EVALUACIONES (100 PUNTOS & INTENTOS)
   ========================================================================== */
.eval-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(16px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.eval-modal-overlay.active {
    display: flex;
}

.eval-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(35px);
    border-radius: 16px;
    width: 100%;
    max-width: 760px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px 34px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    position: relative;
    animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.dark-theme .eval-card {
    background: rgba(28, 32, 42, 0.95);
    border-color: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.eval-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 14px;
    margin-bottom: 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.dark-theme .eval-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.eval-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--win11-accent);
    margin-bottom: 4px;
}

.dark-theme .eval-title {
    color: #60cdff;
}

.eval-subtitle {
    font-size: 12.5px;
    color: var(--win11-text-secondary);
}

.dark-theme .eval-subtitle {
    color: var(--win11-text-dark-secondary);
}

.eval-meta-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.eval-attempts-badge {
    background: #eef2ff;
    color: #4f46e5;
    border: 1px solid rgba(79, 70, 229, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.dark-theme .eval-attempts-badge {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.4);
}

.eval-score-rule-badge {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid rgba(180, 83, 9, 0.2);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.dark-theme .eval-score-rule-badge {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}

.eval-questions-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 20px;
}

.eval-q-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 14px 16px;
    transition: all 0.2s;
}

.dark-theme .eval-q-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.eval-q-card.q-correct {
    border-color: #107c41;
    background: rgba(16, 124, 65, 0.05);
}

.eval-q-card.q-incorrect {
    border-color: #d13438;
    background: rgba(209, 52, 56, 0.05);
}

.eval-q-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13.5px;
    font-weight: 700;
}

.eval-q-points {
    font-size: 11px;
    font-weight: 700;
    color: var(--win11-accent);
    background: rgba(0, 103, 192, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
}

.dark-theme .eval-q-points {
    color: #60cdff;
    background: rgba(76, 194, 255, 0.15);
}

.eval-options-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.eval-option-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

.dark-theme .eval-option-row {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.eval-option-row:hover {
    background: rgba(0, 103, 192, 0.08);
    border-color: var(--win11-accent);
}

.dark-theme .eval-option-row:hover {
    background: rgba(76, 194, 255, 0.12);
    border-color: #60cdff;
}

.eval-option-row.selected {
    background: #e5f1fb;
    border-color: #0067c0;
    font-weight: 600;
    color: #005fb8;
}

.dark-theme .eval-option-row.selected {
    background: rgba(0, 103, 192, 0.3);
    border-color: #60cdff;
    color: #fff;
}

.eval-option-row.opt-correct {
    background: #dff6dd !important;
    border-color: #107c41 !important;
    color: #107c41 !important;
    font-weight: 700;
}

.dark-theme .eval-option-row.opt-correct {
    background: rgba(16, 124, 65, 0.3) !important;
    border-color: #72d99d !important;
    color: #72d99d !important;
}

.eval-option-row.opt-wrong {
    background: #fde7e9 !important;
    border-color: #d13438 !important;
    color: #d13438 !important;
}

.dark-theme .eval-option-row.opt-wrong {
    background: rgba(209, 52, 56, 0.3) !important;
    border-color: #ff8588 !important;
    color: #ff8588 !important;
}

.eval-explanation {
    margin-top: 8px;
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.03);
    border-left: 3px solid #666;
    color: #444;
    display: none;
}

.dark-theme .eval-explanation {
    background: rgba(255, 255, 255, 0.04);
    color: #ccc;
    border-left-color: #888;
}

.eval-result-banner {
    padding: 16px 20px;
    border-radius: 12px;
    margin-top: 16px;
    text-align: center;
    display: none;
    animation: fadeIn 0.3s ease;
}

.eval-result-banner.failed {
    background: #fde7e9;
    border: 1.5px solid #d13438;
    color: #a80000;
}

.dark-theme .eval-result-banner.failed {
    background: rgba(209, 52, 56, 0.2);
    border-color: #d13438;
    color: #ff999b;
}

.eval-result-banner.passed {
    background: #dff6dd;
    border: 1.5px solid #107c41;
    color: #0b5c30;
}

.dark-theme .eval-result-banner.passed {
    background: rgba(16, 124, 65, 0.2);
    border-color: #107c41;
    color: #72d99d;
}

.eval-result-score {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 4px;
}

.eval-result-message {
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 12px;
}

.eval-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}

.eval-btn-submit {
    background: linear-gradient(135deg, #0067c0 0%, #00529b 100%);
    color: #fff;
    padding: 10px 22px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 103, 192, 0.3);
    transition: all 0.2s;
}

.eval-btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 103, 192, 0.4);
}

.eval-btn-retry {
    background: #e65100;
    color: #fff;
    padding: 10px 22px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(230, 81, 0, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.eval-btn-retry:hover {
    background: #ef6c00;
}

.eval-btn-next {
    background: #107c41;
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    font-size: 13.5px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 124, 65, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.eval-btn-next:hover {
    background: #0b5c30;
}

/* ==========================================================================
   RESPLANDOR Y GUÍA DEL TUTOR (TARGET GLOW)
   ========================================================================== */
.simulator-target-glow {
    outline: 3px solid #ffaa00 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 20px 4px rgba(255, 170, 0, 0.75) !important;
    animation: targetPulse 1.4s infinite alternate !important;
    z-index: 9999 !important;
}

#taskbar.simulator-target-glow {
    position: fixed !important;
    bottom: 0 !important;
    top: auto !important;
    left: 0 !important;
    width: 100% !important;
}

@keyframes targetPulse {
    0% {
        box-shadow: 0 0 10px 2px rgba(255, 170, 0, 0.5);
    }
    100% {
        box-shadow: 0 0 24px 6px rgba(255, 170, 0, 0.95);
    }
}

/* ==========================================================================
   CERTIFICADO DIGITAL DE APROBACIÓN
   ========================================================================== */
.cert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(14px);
    z-index: 999999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px 40px 16px;
    overflow-y: auto;
}

.cert-overlay.active {
    display: flex;
}

.cert-container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

.cert-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(20, 24, 33, 0.95);
    backdrop-filter: blur(10px);
    padding: 10px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cert-btn-back {
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #2b303c;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.2s;
}

.cert-btn-back:hover {
    background: #3b4252;
}

.cert-actions-right {
    display: flex;
    gap: 10px;
}

.cert-btn-action, .cert-btn-close {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.cert-btn-action {
    background: #0067c0;
    color: #fff;
}

.cert-btn-action:hover {
    background: #00529b;
}

.cert-btn-pdf {
    background: #d83b01;
    color: #fff;
}

.cert-btn-pdf:hover {
    background: #b83000;
}

.cert-btn-close {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.cert-btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.cert-frame {
    background: #ffffff;
    color: #1a1a1a;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    font-family: 'Georgia', 'Times New Roman', serif;
}

.cert-border-outer {
    border: 4px solid #1a365d;
    padding: 8px;
}

.cert-border-inner {
    border: 2px solid #b7791f;
    padding: 30px 38px;
    text-align: center;
    position: relative;
    background: #fafaf8;
}

.cert-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-25deg);
    font-size: 72px;
    font-weight: 900;
    color: rgba(0, 103, 192, 0.04);
    letter-spacing: 6px;
    pointer-events: none;
    z-index: 1;
}

.cert-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
    position: relative;
    z-index: 2;
    text-align: center;
}

.cert-logo {
    height: 60px;
    max-width: 180px;
    object-fit: contain;
    margin: 0 auto;
}

.cert-institution-box {
    text-align: center;
}

.cert-institution {
    font-size: 24px;
    font-weight: 800;
    color: #1a365d;
    letter-spacing: 1px;
    margin: 0 0 2px 0;
    font-family: var(--font-fluent);
    text-align: center;
}

.cert-tagline {
    font-size: 11.5px;
    color: #555;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: var(--font-fluent);
    text-align: center;
    margin: 0;
}

.cert-badge-ribbon {
    display: inline-block;
    background: #b7791f;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 4px 16px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-family: var(--font-fluent);
}

.cert-title {
    font-size: 27px;
    font-weight: 800;
    color: #1a365d;
    letter-spacing: 2px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.cert-subtitle {
    font-size: 13.5px;
    color: #555;
    font-style: italic;
    margin-bottom: 10px;
}

.cert-student-name {
    font-size: 32px;
    font-weight: 700;
    color: #005fb8;
    text-decoration: underline;
    text-underline-offset: 6px;
    margin-bottom: 12px;
    font-family: var(--font-fluent);
}

.cert-text {
    font-size: 14px;
    color: #444;
    margin-bottom: 6px;
}

.cert-course-name {
    font-size: 21px;
    font-weight: 800;
    color: #1a365d;
    letter-spacing: 1px;
    margin-bottom: 10px;
    font-family: var(--font-fluent);
}

.cert-description {
    font-size: 12.5px;
    line-height: 1.55;
    color: #4a5568;
    max-width: 680px;
    margin: 0 auto 16px auto;
    font-family: var(--font-fluent);
}

.cert-meta-grid {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 20px;
    font-size: 12px;
    font-family: var(--font-fluent);
}

.meta-label {
    color: #718096;
    font-weight: 600;
}

.meta-val {
    color: #1a202c;
    font-weight: 700;
}

.cert-signatures {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    margin-top: 18px;
    padding-top: 10px;
}

.sig-block {
    text-align: center;
    width: 250px;
    font-family: var(--font-fluent);
}

.sig-line {
    border-bottom: 1.5px solid #2d3748;
    margin-bottom: 6px;
    padding-bottom: 2px;
}

.sig-handwritten {
    font-family: 'Brush Script MT', cursive, serif;
    font-size: 24px;
    color: #00529b;
}

.sig-name {
    font-size: 13px;
    font-weight: 700;
    color: #1a202c;
}

.sig-title {
    font-size: 10.5px;
    color: #4a5568;
}

.sig-org {
    font-size: 10.5px;
    color: #005fb8;
    font-weight: 600;
}

.official-seal {
    width: 76px;
    height: 76px;
    border: 3px double #b7791f;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
}

.seal-inner {
    width: 100%;
    height: 100%;
    border: 1px dashed #b7791f;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 800;
    color: #b7791f;
    font-family: var(--font-fluent);
}

.seal-star {
    font-size: 8px;
    margin: 1px 0;
}

.cert-footer-code {
    margin-top: 16px;
    font-size: 9.5px;
    color: #a0aec0;
    font-family: var(--font-fluent);
}

/* Flash de captura */
.snip-flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.6);
    z-index: 9999999;
    pointer-events: none;
    animation: flashAnim 0.35s ease-out forwards;
}

@keyframes flashAnim {
    0% { opacity: 0.8; }
    100% { opacity: 0; }
}

/* Toast de Notificaciones */
.win11-toast {
    position: fixed;
    bottom: 60px;
    right: 20px;
    background: var(--win11-bg-blur);
    border: 1px solid var(--win11-border);
    backdrop-filter: blur(25px);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    min-width: 260px;
    max-width: 340px;
}

.dark-theme .win11-toast {
    background: var(--win11-bg-dark-blur);
    border-color: var(--win11-border-dark);
    color: #fff;
}

.toast-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--win11-accent);
    margin-bottom: 4px;
}

.toast-body {
    font-size: 12.5px;
    line-height: 1.35;
}

.animate-fade-in { animation: fadeIn 0.3s ease; }
.animate-scale-up { animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1); }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

/* Estilos de Impresión */
@media print {
    body * {
        visibility: hidden;
    }
    #certificate-modal, #certificate-modal * {
        visibility: visible;
    }
    #certificate-modal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: transparent;
        padding: 0;
    }
    .no-print {
        display: none !important;
    }
    .cert-frame {
        box-shadow: none;
        border: none;
        width: 100%;
    }
}
