/* ================================
   CONSTANCIAS UI
   Liquid Glass Design System
================================ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --violet: #705cff;
    --purple: #9f5cff;
    --pink: #ec4ca6;
    --hot-pink: #ff4f9a;
    --orange: #ff845c;
    --peach: #ffb26b;

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.72);
    --text-muted: rgba(255, 255, 255, 0.52);

    --glass-bg: rgba(255, 255, 255, 0.11);
    --glass-bg-hover: rgba(255, 255, 255, 0.16);
    --glass-border: rgba(255, 255, 255, 0.20);
    --glass-highlight: rgba(255, 255, 255, 0.28);

    --shadow-soft: 0 20px 60px rgba(31, 18, 69, 0.18);
    --shadow-button: 0 12px 30px rgba(126, 70, 255, 0.28);

    --radius-sm: 14px;
    --radius-md: 22px;
    --radius-lg: 32px;

    --transition: 0.25s ease;
}


/* ================================
   RESET
================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: "Manrope", sans-serif;
    color: var(--text-primary);
    overflow-x: hidden;

    background:
        radial-gradient(
            circle at 10% 0%,
            rgba(112, 92, 255, 0.95) 0%,
            rgba(112, 92, 255, 0) 38%
        ),
        radial-gradient(
            circle at 92% 18%,
            rgba(236, 76, 166, 0.95) 0%,
            rgba(236, 76, 166, 0) 42%
        ),
        radial-gradient(
            circle at 55% 100%,
            rgba(255, 178, 107, 0.95) 0%,
            rgba(255, 178, 107, 0) 48%
        ),
        linear-gradient(
            145deg,
            #5e55ed 0%,
            #b54fcd 48%,
            #ff796b 78%,
            #ffb66f 100%
        );

    background-attachment: fixed;
}


/* luces ambientales */

body::before,
body::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    filter: blur(110px);
    pointer-events: none;
    z-index: -1;
}

body::before {
    width: 500px;
    height: 500px;
    top: -180px;
    left: -100px;
    background: rgba(77, 62, 255, 0.55);
}

body::after {
    width: 550px;
    height: 550px;
    right: -160px;
    bottom: -200px;
    background: rgba(255, 161, 92, 0.55);
}


/* ================================
   LAYOUT
================================ */

.page {
    width: min(1180px, calc(100% - 40px));
    min-height: 100vh;
    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 50px 0;
}


/* ================================
   GLASS
================================ */

.glass {
    background: var(--glass-bg);

    border: 1px solid var(--glass-border);

    box-shadow:
        var(--shadow-soft),
        inset 0 1px 0 var(--glass-highlight);

    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);

    border-radius: var(--radius-lg);
}


/* ================================
   HERO PUBLICO
================================ */

.search-card {
    width: min(760px, 100%);
    padding: 64px;

    text-align: center;

    animation: appear 0.7s ease;
}

.search-card .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 8px 14px;
    margin-bottom: 22px;

    border-radius: 999px;

    background: rgba(255,255,255,0.11);
    border: 1px solid rgba(255,255,255,0.16);

    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
}

.search-card h1 {
    font-size: clamp(2.3rem, 6vw, 4.3rem);
    line-height: 1;
    letter-spacing: -0.055em;
    font-weight: 800;

    margin-bottom: 22px;
}

.search-card p {
    max-width: 560px;
    margin: 0 auto 38px;

    color: var(--text-secondary);

    font-size: 1.05rem;
    line-height: 1.75;
}


/* ================================
   FORM
================================ */

.search-form {
    display: flex;
    gap: 12px;

    padding: 10px;

    background: rgba(255,255,255,0.09);

    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 22px;

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.18);

    transition: var(--transition);
}

.search-form:focus-within {
    background: rgba(255,255,255,0.13);

    border-color: rgba(255,255,255,0.35);

    box-shadow:
        0 0 0 5px rgba(255,255,255,0.05),
        inset 0 1px 0 rgba(255,255,255,0.25);
}

.search-form input {
    flex: 1;

    min-width: 0;

    padding: 17px 18px;

    background: transparent;
    border: none;
    outline: none;

    color: white;

    font-family: inherit;
    font-size: 1rem;
}

.search-form input::placeholder {
    color: rgba(255,255,255,0.52);
}


/* ================================
   BUTTONS
================================ */

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;

    gap: 9px;

    border: 0;
    outline: 0;

    cursor: pointer;

    padding: 16px 23px;

    border-radius: 16px;

    font-family: inherit;
    font-weight: 700;
    font-size: 0.94rem;

    transition:
        transform var(--transition),
        box-shadow var(--transition),
        background var(--transition);
}

.btn-primary {
    background: rgba(255,255,255,0.92);

    color: #b54691;

    box-shadow: var(--shadow-button);
}

.btn-primary:hover {
    transform: translateY(-2px);

    background: #ffffff;

    box-shadow:
        0 18px 40px rgba(98, 53, 211, 0.30);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-glass {
    color: white;

    background: rgba(255,255,255,0.10);

    border: 1px solid rgba(255,255,255,0.16);
}

.btn-glass:hover {
    background: rgba(255,255,255,0.17);
    transform: translateY(-1px);
}


/* ================================
   RESULTADOS
================================ */

.results-container {
    width: min(900px, 100%);
}

.results-header {
    margin-bottom: 28px;
}

.results-header h1 {
    font-size: clamp(2rem, 5vw, 3.3rem);
    letter-spacing: -0.045em;
    margin-bottom: 8px;
}

.results-header p {
    color: var(--text-secondary);
}

.events-grid {
    display: grid;
    gap: 18px;
}

.event-card {
    padding: 28px;

    background: rgba(255,255,255,0.10);

    border: 1px solid rgba(255,255,255,0.17);

    border-radius: var(--radius-md);

    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);

    box-shadow:
        0 18px 45px rgba(41, 26, 82, 0.12),
        inset 0 1px 0 rgba(255,255,255,0.16);

    transition: var(--transition);
}

.event-card:hover {
    transform: translateY(-4px);

    background: rgba(255,255,255,0.14);

    border-color: rgba(255,255,255,0.28);
}

.event-card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.event-card .date {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 22px;
}

.event-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}


/* ================================
   EMPTY STATE
================================ */

.empty-state {
    width: min(650px, 100%);
    padding: 55px;

    text-align: center;
}

.empty-icon {
    width: 68px;
    height: 68px;

    display: grid;
    place-items: center;

    margin: 0 auto 22px;

    border-radius: 20px;

    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);

    font-size: 1.7rem;
}

.empty-state h1 {
    font-size: 2rem;
    margin-bottom: 12px;
}

.empty-state p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 25px;
}


/* ================================
   SMALL TEXT
================================ */

.privacy-note {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;

    margin-top: 20px;

    color: var(--text-muted);

    font-size: 0.78rem;
}


/* ================================
   ANIMATIONS
================================ */

@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
        filter: blur(7px);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}


/* ================================
   RESPONSIVE
================================ */

@media (max-width: 720px) {

    .page {
        width: min(100% - 24px, 1180px);
        padding: 24px 0;
    }

    .search-card {
        padding: 42px 24px;
    }

    .search-card h1 {
        line-height: 1.05;
    }

    .search-form {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .event-card {
        padding: 22px;
    }
}
/* ================================
   ORGANIZACIONES
================================ */

.organizations-grid {
    display: grid;
    gap: 18px;
}

.organization-card {
    min-height: 170px;

    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 25px;

    padding: 28px;

    background: rgba(255, 255, 255, 0.10);

    border: 1px solid rgba(255, 255, 255, 0.18);

    border-radius: var(--radius-md);

    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);

    box-shadow:
        0 18px 45px rgba(41, 26, 82, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.17);

    transition:
        transform var(--transition),
        background var(--transition),
        border-color var(--transition);
}

.organization-card:hover {
    transform: translateY(-4px);

    background: rgba(255, 255, 255, 0.14);

    border-color: rgba(255, 255, 255, 0.29);
}


.organization-logo {
    width: 82px;
    height: 82px;

    flex-shrink: 0;

    display: grid;
    place-items: center;

    border-radius: 24px;

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,0.26),
            rgba(255,255,255,0.08)
        );

    border: 1px solid rgba(255,255,255,0.23);

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.30),
        0 12px 30px rgba(53,31,104,0.15);

    color: white;

    font-size: 2rem;
    font-weight: 800;
}

.organization-logo img {
    width: 72%;
    height: 72%;

    object-fit: contain;
}


.organization-info {
    min-width: 0;
}

.organization-label {
    display: block;

    margin-bottom: 5px;

    color: var(--text-muted);

    font-size: 0.72rem;
    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.12em;
}

.organization-info h2 {
    margin-bottom: 3px;

    font-size: 1.65rem;
    letter-spacing: -0.035em;
}

.organization-info p {
    margin-bottom: 12px;

    color: var(--text-secondary);

    line-height: 1.5;
}


.event-counter {
    display: inline-flex;

    padding: 6px 10px;

    background: rgba(255,255,255,0.09);

    border: 1px solid rgba(255,255,255,0.13);

    border-radius: 999px;

    color: var(--text-secondary);

    font-size: 0.76rem;
    font-weight: 600;
}


.back-action {
    margin-top: 25px;
}


.event-card-content {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 30px;
}


.pending-badge {
    padding: 9px 13px;

    border-radius: 999px;

    background: rgba(255,255,255,0.09);

    border: 1px solid rgba(255,255,255,0.15);

    color: var(--text-secondary);

    font-size: 0.78rem;
    font-weight: 600;
}


/* móvil */

@media (max-width: 720px) {

    .organization-card {
        grid-template-columns: 1fr;

        align-items: flex-start;
    }

    .organization-logo {
        width: 68px;
        height: 68px;

        border-radius: 20px;
    }

    .organization-card .btn {
        width: 100%;
    }

    .event-card-content {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ================================
   ADMIN
================================ */

.admin-login-form {
    display: grid;
    gap: 14px;

    max-width: 460px;

    margin: 0 auto;
}

.admin-login-form input {
    width: 100%;

    padding: 17px 18px;

    border: 1px solid rgba(255,255,255,0.18);

    border-radius: 16px;

    background: rgba(255,255,255,0.10);

    color: white;

    font-family: inherit;
    font-size: 1rem;

    outline: none;

    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    transition: var(--transition);
}

.admin-login-form input::placeholder {
    color: rgba(255,255,255,0.52);
}

.admin-login-form input:focus {
    background: rgba(255,255,255,0.14);

    border-color: rgba(255,255,255,0.35);

    box-shadow:
        0 0 0 5px rgba(255,255,255,0.05);
}

.admin-error {
    margin: 0 auto 20px;

    max-width: 460px;

    padding: 13px 16px;

    border-radius: 14px;

    background: rgba(255, 70, 100, 0.16);

    border: 1px solid rgba(255,255,255,0.18);

    color: white;

    font-size: 0.9rem;
}

.admin-dashboard-card {
    padding: 32px;
}

.admin-dashboard-card h2 {
    margin-bottom: 8px;
}

.admin-dashboard-card p {
    margin-bottom: 22px;

    color: var(--text-secondary);
}

/* ================================
   ADMIN DASHBOARD
================================ */

.admin-dashboard {
    width: min(1000px, 100%);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);

    gap: 18px;

    margin-bottom: 35px;
}

.stat-card {
    padding: 28px;
}

.stat-label {
    display: block;

    margin-bottom: 12px;

    color: var(--text-secondary);

    font-size: 0.85rem;
    font-weight: 600;
}

.stat-card strong {
    display: block;

    font-size: 2.6rem;
    letter-spacing: -0.05em;
}

.dashboard-section {
    margin-top: 15px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 18px;
}

.section-header h2 {
    font-size: 1.65rem;
    letter-spacing: -0.035em;
}

.empty-admin-card {
    padding: 30px;

    color: var(--text-secondary);
}


@media (max-width: 720px) {

    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}

.admin-login-form textarea {
    width: 100%;

    padding: 17px 18px;

    border: 1px solid rgba(255,255,255,0.18);

    border-radius: 16px;

    background: rgba(255,255,255,0.10);

    color: white;

    font-family: inherit;
    font-size: 1rem;

    outline: none;

    resize: vertical;

    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    transition: var(--transition);
}

.admin-login-form textarea::placeholder {
    color: rgba(255,255,255,0.52);
}

.admin-login-form textarea:focus {
    background: rgba(255,255,255,0.14);

    border-color: rgba(255,255,255,0.35);

    box-shadow:
        0 0 0 5px rgba(255,255,255,0.05);
}

.organization-card-link {
    display: block;

    color: inherit;
    text-decoration: none;
}

.organization-arrow {
    margin-left: auto;

    color: rgba(255, 255, 255, 0.75);

    font-size: 1.5rem;

    transition: transform var(--transition);
}

.organization-card-link:hover .organization-arrow {
    transform: translateX(5px);
}

.event-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-left: auto;
}

.event-actions form {
    margin: 0;
}

.btn-danger {
    color: white;

    background: rgba(255, 70, 90, 0.18);

    border: 1px solid rgba(255, 120, 130, 0.28);
}

.btn-danger:hover {
    background: rgba(255, 70, 90, 0.30);
}
.form-label {
    margin: 4px 4px -5px;

    color: var(--text-secondary);

    font-size: 0.82rem;
    font-weight: 600;

    text-align: left;
}
.event-actions-column {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;

    min-width: 220px;
}

.event-secondary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.event-secondary-actions form {
    margin: 0;
}

.event-secondary-actions .btn {
    width: 100%;
}
.event-actions-column {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;

    min-width: 220px;
}

.event-secondary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.event-secondary-actions form {
    margin: 0;
}

.event-secondary-actions .btn {
    width: 100%;
}

/* ================================
   ASISTENTES - REDISEÑO
================================ */

.attendees-import-card {
    padding: 28px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;

    margin-bottom: 28px;
}

.attendees-import-info {
    flex: 1;
}

.attendees-import-info h3 {
    margin: 5px 0 8px;

    font-size: 1.2rem;
}

.attendees-import-info p {
    max-width: 520px;

    color: var(--text-secondary);

    font-size: 0.9rem;
    line-height: 1.6;
}

.attendees-import-form {
    display: flex;
    align-items: center;

    gap: 12px;
}


/* INPUT DE ARCHIVO */

.file-upload {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 200px;

    padding: 15px 18px;

    border-radius: 16px;

    background: rgba(255,255,255,0.10);

    border: 1px solid rgba(255,255,255,0.18);

    color: white;

    font-size: 0.9rem;
    font-weight: 600;

    cursor: pointer;

    transition: var(--transition);
}

.file-upload:hover {
    background: rgba(255,255,255,0.16);

    border-color: rgba(255,255,255,0.28);
}

.file-upload input {
    position: absolute;

    inset: 0;

    opacity: 0;

    cursor: pointer;
}


/* LISTA */

.attendees-section {
    margin-top: 10px;
}

.attendees-table {
    overflow: hidden;
}

.attendees-table-header,
.attendees-table-row {
    display: grid;

    grid-template-columns: 1fr 1fr;

    align-items: center;

    gap: 25px;
}

.attendees-table-header {
    padding: 16px 22px;

    border-bottom: 1px solid rgba(255,255,255,0.14);

    color: var(--text-muted);

    font-size: 0.75rem;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.attendees-table-row {
    padding: 16px 22px;

    border-bottom: 1px solid rgba(255,255,255,0.09);

    transition: background var(--transition);
}

.attendees-table-row:last-child {
    border-bottom: none;
}

.attendees-table-row:hover {
    background: rgba(255,255,255,0.06);
}

.attendee-name {
    display: flex;
    align-items: center;

    gap: 12px;
}

.attendee-avatar {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    border-radius: 12px;

    background: rgba(255,255,255,0.12);

    border: 1px solid rgba(255,255,255,0.18);

    font-weight: 700;
}

.attendee-email {
    color: var(--text-secondary);

    font-size: 0.9rem;
}


/* MOBILE */

@media (max-width: 720px) {

    .attendees-import-card {
        align-items: stretch;
        flex-direction: column;
    }

    .attendees-import-form {
        align-items: stretch;
        flex-direction: column;
    }

    .file-upload {
        width: 100%;
    }

    .attendees-table-header {
        display: none;
    }

    .attendees-table-row {
        grid-template-columns: 1fr;

        gap: 8px;
    }

    .attendee-email {
        padding-left: 50px;
    }
}

/* ================================
   GESTIÓN DE PARTICIPANTES
================================ */

.attendees-admin-list {
    display: grid;
    gap: 12px;
}

.attendee-admin-row {
    display: grid;

    grid-template-columns: minmax(0, 1fr) auto auto;

    align-items: center;

    gap: 22px;

    padding: 18px 22px;

    transition:
        opacity var(--transition),
        background var(--transition);
}

.attendee-main-info {
    display: flex;
    align-items: center;

    gap: 14px;

    min-width: 0;
}

.attendee-main-info strong {
    display: block;

    margin-bottom: 4px;
}

.attendee-main-info p {
    color: var(--text-secondary);

    font-size: 0.88rem;
}

.attendee-id {
    margin-bottom: 3px;

    color: var(--text-muted);

    font-size: 0.68rem;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.attendee-actions {
    display: flex;
    align-items: center;

    gap: 8px;
}

.attendee-actions form {
    margin: 0;
}

.status-badge {
    display: inline-flex;

    padding: 7px 11px;

    border-radius: 999px;

    font-size: 0.76rem;
    font-weight: 700;
}

.status-active {
    background: rgba(90, 255, 175, 0.13);

    border: 1px solid rgba(120, 255, 190, 0.20);
}

.status-inactive {
    background: rgba(255, 255, 255, 0.08);

    border: 1px solid rgba(255, 255, 255, 0.14);

    color: var(--text-muted);
}

.attendee-inactive {
    opacity: 0.58;
}

.attendee-inactive:hover {
    opacity: 0.78;
}


@media (max-width: 720px) {

    .attendee-admin-row {
        grid-template-columns: 1fr;

        align-items: stretch;
    }

    .attendee-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .attendee-actions .btn {
        width: 100%;
    }
}

.section-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.section-actions form {
    margin: 0;
}

/* ================================
   BUSCADOR DE ASISTENTES
================================ */

.attendees-search {
    display: flex;
    align-items: center;
    gap: 16px;

    padding: 12px;

    margin-bottom: 18px;
}

.attendees-search input {
    flex: 1;

    min-width: 0;

    padding: 15px 18px;

    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 16px;

    background: rgba(255,255,255,0.08);

    color: white;

    font-family: inherit;
    font-size: 0.95rem;

    outline: none;

    transition: var(--transition);
}

.attendees-search input::placeholder {
    color: var(--text-muted);
}

.attendees-search input:focus {
    background: rgba(255,255,255,0.13);

    border-color: rgba(255,255,255,0.30);

    box-shadow:
        0 0 0 5px rgba(255,255,255,0.04);
}

#contador-resultados {
    flex-shrink: 0;

    padding: 8px 12px;

    border-radius: 999px;

    background: rgba(255,255,255,0.08);

    border: 1px solid rgba(255,255,255,0.13);

    color: var(--text-secondary);

    font-size: 0.78rem;
    font-weight: 600;
}


@media (max-width: 720px) {

    .attendees-search {
        align-items: stretch;
        flex-direction: column;
    }

    #contador-resultados {
        align-self: flex-start;
    }
}

/* ================================
   PLANTILLA DE CONSTANCIA
================================ */

.template-preview-section {
    margin-top: 28px;
}

.template-preview {
    margin-top: 10px;
    padding: 18px;

    overflow: hidden;
}

.template-preview img {
    display: block;

    width: 100%;
    height: auto;

    border-radius: 18px;
}

.top-back-action{
    margin-top:24px;
    margin-bottom:28px;
}

.top-back-action .btn{
    width:fit-content;
}

/* ================================
   EDITOR DE CONSTANCIA
================================ */

.template-editor-section {
    margin-top: 28px;
}

.template-editor-wrapper {
    padding: 18px;
    overflow: hidden;
}

.template-editor-canvas {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 18px;
    user-select: none;
}

.template-editor-canvas img {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
}

.certificate-name-preview {
    position: absolute;

    transform: translate(-50%, -50%);

    padding: 8px 14px;

    border-radius: 10px;

    background: rgba(255, 255, 255, 0.88);

    border: 1px dashed rgba(0, 0, 0, 0.45);

    color: #111;

    font-size: clamp(14px, 2vw, 28px);
    font-weight: 700;

    white-space: nowrap;

    cursor: grab;

    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.15);

    z-index: 10;
}

.certificate-name-preview.dragging {
    cursor: grabbing;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.25);
}

.template-position-form {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-top: 18px;

    padding: 18px 22px;
}

.position-info {
    display: flex;
    gap: 30px;
}

.position-info > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.position-info strong {
    font-size: 1rem;
}


@media (max-width: 720px) {

    .template-position-form {
        flex-direction: column;
        align-items: stretch;
    }

    .position-info {
        justify-content: space-between;
    }
}
/* ================================
   SMART GUIDES
================================ */

.smart-guide {
    position: absolute;

    pointer-events: none;

    opacity: 0;

    z-index: 8;

    transition: opacity 0.12s ease;
}

.smart-guide.visible {
    opacity: 1;
}

.smart-guide-vertical {
    top: 0;
    bottom: 0;
    left: 50%;

    width: 1px;

    transform: translateX(-50%);

    background: rgba(255, 0, 170, 0.85);

    box-shadow:
        0 0 8px rgba(255, 0, 170, 0.45);
}

.smart-guide-horizontal {
    left: 0;
    right: 0;
    top: 50%;

    height: 1px;

    transform: translateY(-50%);

    background: rgba(0, 220, 255, 0.85);

    box-shadow:
        0 0 8px rgba(0, 220, 255, 0.45);
}

.smart-guide-center {
    position: absolute;

    left: 50%;
    top: 50%;

    transform: translate(-50%, -50%);

    width: 24px;
    height: 24px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.92);

    color: #111;

    font-size: 15px;
    font-weight: 800;

    opacity: 0;

    pointer-events: none;

    z-index: 9;

    box-shadow:
        0 0 0 1px rgba(255,255,255,0.3),
        0 6px 18px rgba(0,0,0,0.15);

    transition: opacity 0.12s ease;
}

.smart-guide-center.visible {
    opacity: 1;
}

/* ================================
   CONTROLES DE CONSTANCIA
================================ */

.certificate-controls {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;

    margin-top: 18px;

    padding: 24px;
}

.certificate-control-group {
    display: flex;
    flex-direction: column;

    gap: 9px;
}

.certificate-control-group select {
    width: 100%;

    padding: 13px 14px;

    border: 1px solid rgba(255,255,255,0.16);

    border-radius: 14px;

    background: rgba(255,255,255,0.08);

    color: white;

    font-family: inherit;
    font-size: 0.9rem;

    outline: none;
}

.certificate-control-group select option {
    color: #111;
}


/* TAMAÑO */

.font-size-control {
    display: flex;
    align-items: center;

    gap: 12px;
}

.font-size-control input {
    flex: 1;
}

.font-size-control strong {
    min-width: 36px;

    text-align: right;
}


/* COLOR */

.color-control {
    display: flex;
    align-items: center;

    gap: 12px;
}

.color-control input[type="color"] {
    width: 48px;
    height: 42px;

    padding: 3px;

    border: 1px solid rgba(255,255,255,0.16);

    border-radius: 12px;

    background: rgba(255,255,255,0.08);

    cursor: pointer;
}

.color-control span {
    color: var(--text-secondary);

    font-size: 0.85rem;
}


/* CHECKBOXES */

.certificate-checkbox {
    display: flex;
    align-items: center;

    gap: 9px;

    color: var(--text-secondary);

    font-size: 0.9rem;

    cursor: pointer;
}

.certificate-checkbox input {
    width: 17px;
    height: 17px;

    accent-color: white;
}


/* GUARDAR */

.certificate-save {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}


/* EL TEXTO DEL EDITOR YA NO NECESITA
   FONDO TAN FUERTE */

.certificate-name-preview {
    background: rgba(255,255,255,0.18);

    border:
        1px dashed
        rgba(255,255,255,0.65);

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    padding: 5px 9px;
}


/* MOBILE */

@media (max-width: 850px) {

    .certificate-controls {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 600px) {

    .certificate-controls {
        grid-template-columns: 1fr;
    }

    .certificate-save .btn {
        width: 100%;
    }

}

/* =========================================
   PARCHE REAL - NUEVO PARTICIPANTE CENTRADO
========================================= */

.new-participant-card {
    width: 100% !important;
    max-width: 760px !important;

    margin-top: 28px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* =========================================
   CONSTANCIAS PÚBLICAS
   No afecta las tarjetas del administrador
========================================= */

.public-certificates-list .event-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.public-certificates-list .event-info {
    flex: 1;
    min-width: 0;
}

.public-certificates-list .event-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.public-certificates-list .event-actions .btn {
    white-space: nowrap;
}


/* RESPONSIVE */

@media (max-width: 700px) {

    .public-certificates-list .event-card {
        flex-direction: column;
        align-items: stretch;
    }

    .public-certificates-list .event-actions {
        justify-content: flex-start;
    }

    .public-certificates-list .event-actions .btn {
        width: 100%;
        text-align: center;
    }
}

/* =========================================
   EVENTOS ADMIN - LAYOUT CORREGIDO
========================================= */

.admin-event-card {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 32px;

    padding: 26px 28px;
}

.admin-event-info {
    flex: 1;
    min-width: 0;
}

.admin-event-actions {
    flex-shrink: 0;

    display: flex;
    flex-direction: column;

    gap: 10px;

    align-items: flex-end;
}

.admin-event-actions-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 10px;
}

.admin-event-actions-row form {
    margin: 0;
}

.admin-event-actions .btn {
    white-space: nowrap;
}

.certificate-status-wrapper {
    margin-top: 12px;
}

.certificate-toggle-btn {
    min-width: 190px;
}


/* MOBILE */

@media (max-width: 760px) {

    .admin-event-card {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-event-actions {
        align-items: stretch;
    }

    .admin-event-actions-row {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

}

/* =========================================
   EVENTOS ADMIN - BOTONES SIMÉTRICOS
========================================= */

.admin-event-actions {
    display: grid !important;
    grid-template-columns: repeat(2, 130px);
    gap: 10px;

    justify-content: end;
    align-items: center;
}

.admin-event-actions-row {
    display: contents;
}

.admin-event-actions-row form {
    margin: 0;
    width: 100%;
}

.admin-event-actions .btn {
    width: 100%;
    min-width: 0 !important;
    box-sizing: border-box;
    text-align: center;
}


/* Botón activar/desactivar ocupa ambas columnas */

.admin-event-actions-row:nth-child(2) {
    grid-column: 1 / -1;
}

.admin-event-actions-row:nth-child(2) form {
    grid-column: 1 / -1;
}

.admin-event-actions-row:nth-child(2) .btn {
    width: 100%;
}


/* MOBILE */

@media (max-width: 760px) {

    .admin-event-actions {
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

}

/* =========================================
   EVENTOS PÚBLICOS - MÁS ESPACIO ENTRE TARJETAS
========================================= */

.public-certificates-list {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.public-certificates-list .event-card {
    margin: 0 !important;
    padding: 26px 28px;
}


/* Un poco más de aire entre contenido y botón */

.public-certificates-list .event-info {
    padding-right: 20px;
}


/* Mobile */

@media (max-width: 700px) {

    .public-certificates-list {
        gap: 16px;
    }

    .public-certificates-list .event-card {
        padding: 22px;
    }

    .public-certificates-list .event-info {
        padding-right: 0;
    }
}

/* =========================================
   ADMIN - SEPARACIÓN REAL ENTRE EVENTOS
========================================= */

.events-admin-list {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.admin-event-card {
    margin: 0 !important;
}

/* =========================================
   LOGOS DE ORGANIZACIONES
   ========================================= */

.organization-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.organization-logo img {
    width: 78%;
    height: 78%;
    object-fit: contain;
    display: block;
}

/* =========================================================
   SISTEMA DE TEMAS
   ========================================================= */

/* DASHBOARD PRINCIPAL - Negro + azul */

body:has(.theme-main) {
    background:
        radial-gradient(circle at 20% 35%,
            rgba(0, 78, 180, 0.55) 0%,
            rgba(0, 45, 110, 0.30) 32%,
            transparent 60%),
        radial-gradient(circle at 85% 75%,
            rgba(0, 55, 130, 0.35) 0%,
            transparent 55%),
        linear-gradient(135deg,
            #010611 0%,
            #001630 48%,
            #003b7a 100%);
    background-attachment: fixed;
}

/* AMEMGEN - Rosa + coral */

body:has(.theme-amemgen) {
    background:
        radial-gradient(circle at 15% 15%,
            rgba(236, 76, 166, 0.72) 0%,
            rgba(236, 76, 166, 0.25) 32%,
            transparent 55%),
        radial-gradient(circle at 85% 80%,
            rgba(255, 105, 105, 0.58) 0%,
            rgba(255, 105, 105, 0.18) 35%,
            transparent 58%),
        linear-gradient(135deg,
            #b52372 0%,
            #e94b83 48%,
            #944c44 100%);
    background-attachment: fixed;
}

/* AMEC - Rosa + azul marino */

body:has(.theme-amec) {
    background:
        radial-gradient(circle at 15% 18%,
            rgba(236, 36, 126, 0.70) 0%,
            rgba(236, 36, 126, 0.22) 35%,
            transparent 58%),
        radial-gradient(circle at 88% 75%,
            rgba(14, 55, 125, 0.70) 0%,
            rgba(14, 55, 125, 0.25) 38%,
            transparent 60%),
        linear-gradient(135deg,
            #e9237c 0%,
            #9b296f 42%,
            #17295b 72%,
            #041329 100%);
    background-attachment: fixed;
}

/* Quita las luces ambientales globales en los tres temas */

body:has(.theme-main)::before,
body:has(.theme-main)::after,
body:has(.theme-amemgen)::before,
body:has(.theme-amemgen)::after,
body:has(.theme-amec)::before,
body:has(.theme-amec)::after {
    display: none;
}

/* El fondo vive en body y la página queda transparente */

.page.theme-main,
.page.theme-amemgen,
.page.theme-amec {
    background: transparent;
}

/* =========================================
   ANIMACIONES DE NAVEGACIÓN / TEMAS
   ========================================= */

.page {
    animation: pageEnter 0.55s cubic-bezier(.22, .61, .36, 1);
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(10px);
        filter: blur(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}


/* Fondo con transición más suave */

.page.theme-main::before,
.page.theme-amemgen::before,
.page.theme-amec::before {
    transition:
        background 0.7s ease,
        opacity 0.7s ease;
}


/* Tarjetas */

.organization-card,
.event-card,
.stat-card,
.attendee-admin-row,
.attendees-import-card {
    opacity: 0;
    transform: translateY(14px);
    animation: cardEnter 0.5s ease forwards;
}

@keyframes cardEnter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Escalonado */

.organization-card:nth-child(1),
.event-card:nth-child(1),
.attendee-admin-row:nth-child(1) {
    animation-delay: 0.08s;
}

.organization-card:nth-child(2),
.event-card:nth-child(2),
.attendee-admin-row:nth-child(2) {
    animation-delay: 0.14s;
}

.organization-card:nth-child(3),
.event-card:nth-child(3),
.attendee-admin-row:nth-child(3) {
    animation-delay: 0.20s;
}

.organization-card:nth-child(4),
.event-card:nth-child(4),
.attendee-admin-row:nth-child(4) {
    animation-delay: 0.26s;
}

.organization-card:nth-child(5),
.event-card:nth-child(5),
.attendee-admin-row:nth-child(5) {
    animation-delay: 0.32s;
}


/* Encabezados */

.results-header,
.top-back-action,
.back-action {
    animation: headerEnter 0.5s ease both;
}

@keyframes headerEnter {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* =========================================
   BOTONES GLASS ARMÓNICOS
   ========================================= */

.btn-primary {
    color: #fff;

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.18),
            rgba(255, 255, 255, 0.08)
        );

    border: 1px solid rgba(255, 255, 255, 0.28);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 10px 30px rgba(0, 0, 0, 0.12);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    text-decoration: none;

    transition:
        transform 0.25s ease,
        background 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}


/* HOVER */

.btn-primary:hover {
    color: #fff;

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.26),
            rgba(255, 255, 255, 0.13)
        );

    border-color: rgba(255, 255, 255, 0.42);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.30),
        0 14px 36px rgba(0, 0, 0, 0.16);

    transform: translateY(-2px);
}


/* CLICK */

.btn-primary:active {
    transform: translateY(0) scale(0.98);

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.15),
            rgba(255, 255, 255, 0.07)
        );
}


/* FOCUS */

.btn-primary:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.75);
    outline-offset: 3px;
}


/* FLECHAS DENTRO DE BOTONES */

.btn-primary span {
    display: inline-block;
    margin-left: 6px;

    transition: transform 0.25s ease;
}

.btn-primary:hover span {
    transform: translateX(4px);
}

.btn-danger {
    color: rgba(255, 255, 255, 0.92);

    background:
        linear-gradient(
            135deg,
            rgba(255, 80, 100, 0.20),
            rgba(180, 20, 60, 0.12)
        );

    border: 1px solid rgba(255, 150, 160, 0.24);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.10),
        0 10px 30px rgba(80, 0, 20, 0.10);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    transition: 0.25s ease;
}

.btn-danger:hover {
    background:
        linear-gradient(
            135deg,
            rgba(255, 80, 100, 0.32),
            rgba(190, 20, 60, 0.20)
        );

    border-color: rgba(255, 170, 180, 0.38);

    transform: translateY(-2px);
}
/* =========================================
   TARJETAS DE ORGANIZACIÓN CLICABLES
   ========================================= */

.organization-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    border-radius: var(--radius-lg);
}

.organization-card-link .organization-card {
    cursor: pointer;

    transition:
        transform 0.28s ease,
        background 0.28s ease,
        border-color 0.28s ease,
        box-shadow 0.28s ease;
}

.organization-card-link:hover .organization-card {
    transform: translateY(-4px);

    background: rgba(255, 255, 255, 0.14);

    border-color: rgba(255, 255, 255, 0.30);

    box-shadow:
        0 20px 45px rgba(0, 0, 0, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.organization-card-link:hover .organization-card-button span {
    transform: translateX(4px);
}

/* =========================================
   TARJETAS DE ORGANIZACIÓN CLICABLES
   + conserva animaciones de hover
   ========================================= */

.organization-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    border-radius: var(--radius-lg);
}


/* TARJETA */

.organization-card-link .organization-card {
    cursor: pointer;

    transition:
        transform 0.28s ease,
        background 0.28s ease,
        border-color 0.28s ease,
        box-shadow 0.28s ease;
}


/* HOVER GENERAL DE LA TARJETA */

.organization-card-link:hover .organization-card {
    transform: translateY(-4px) scale(1.01);

    background: rgba(255, 255, 255, 0.14);

    border-color: rgba(255, 255, 255, 0.30);

    box-shadow:
        0 20px 45px rgba(0, 0, 0, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
}


/* LOGO */

.organization-card-link .organization-logo {
    transition:
        transform 0.28s ease,
        background 0.28s ease,
        box-shadow 0.28s ease;
}

.organization-card-link:hover .organization-logo {
    transform: scale(1.06);

    background: rgba(255, 255, 255, 0.16);

    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}


/* TEXTO */

.organization-card-link .organization-info h2,
.organization-card-link .organization-info p,
.organization-card-link .event-counter {
    transition:
        transform 0.28s ease,
        opacity 0.28s ease;
}

.organization-card-link:hover .organization-info h2 {
    transform: translateX(3px);
}

.organization-card-link:hover .organization-info p {
    transform: translateX(2px);
}


/* BOTÓN VISUAL */

.organization-card-button {
    transition:
        transform 0.28s ease,
        background 0.28s ease,
        border-color 0.28s ease,
        box-shadow 0.28s ease;
}

.organization-card-link:hover .organization-card-button {
    transform: translateY(-2px);

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.26),
            rgba(255, 255, 255, 0.13)
        );

    border-color: rgba(255, 255, 255, 0.42);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 12px 30px rgba(0, 0, 0, 0.14);
}


/* FLECHA */

.organization-card-button span {
    display: inline-block;

    transition:
        transform 0.28s ease;
}

.organization-card-link:hover .organization-card-button span {
    transform: translateX(5px);
}


/* CLICK */

.organization-card-link:active .organization-card {
    transform: translateY(-1px) scale(0.995);
}

/* =========================================
   TARJETA CLICABLE - HOVER ELEGANTE
   ========================================= */

.organization-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    border-radius: var(--radius-lg);
}


/* TARJETA */

.organization-card-link .organization-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;

    transition:
        background 0.28s ease,
        border-color 0.28s ease,
        box-shadow 0.28s ease;
}


/* LUZ INTERNA */

.organization-card-link .organization-card::after {
    content: "";
    position: absolute;
    inset: 0;

    pointer-events: none;

    background:
        radial-gradient(
            circle at 82% 50%,
            rgba(255, 255, 255, 0.16),
            transparent 42%
        );

    opacity: 0;

    transition: opacity 0.32s ease;
}


/* HOVER */

.organization-card-link:hover .organization-card {
    background: rgba(255, 255, 255, 0.13);

    border-color: rgba(255, 255, 255, 0.34);

    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.20),
        inset 0 0 35px rgba(255, 255, 255, 0.035);
}

.organization-card-link:hover .organization-card::after {
    opacity: 1;
}


/* LOGO */

.organization-logo {
    transition:
        border-color 0.28s ease,
        background 0.28s ease,
        box-shadow 0.28s ease;
}

.organization-card-link:hover .organization-logo {
    border-color: rgba(255, 255, 255, 0.30);

    background: rgba(255, 255, 255, 0.14);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 8px 20px rgba(0, 0, 0, 0.10);
}


/* BOTÓN */

.organization-card-button {
    position: relative;
    z-index: 2;

    transition:
        background 0.28s ease,
        border-color 0.28s ease,
        box-shadow 0.28s ease;
}

.organization-card-link:hover .organization-card-button {
    background: rgba(255, 255, 255, 0.20);

    border-color: rgba(255, 255, 255, 0.38);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        0 8px 22px rgba(0, 0, 0, 0.10);
}


/* FLECHA */

.organization-card-button span {
    display: inline-block;

    transition:
        transform 0.28s ease,
        opacity 0.28s ease;
}

.organization-card-link:hover .organization-card-button span {
    transform: translateX(5px);
}


/* CLICK */

.organization-card-link:active .organization-card {
    background: rgba(255, 255, 255, 0.10);
}

/* =========================================================
   MODAL DE CONSTANCIA
   ========================================================= */

body.modal-open {
    overflow: hidden;
}


/* =========================================================
   CONTENEDOR GENERAL
   ========================================================= */

.certificate-modal {
    position: fixed;
    inset: 0;

    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 32px;

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transition:
        opacity 0.35s ease,
        visibility 0.35s ease;
}


.certificate-modal.active {
    opacity: 1;
    visibility: visible;

    pointer-events: auto;
}


/* =========================================================
   FONDO / BACKDROP
   ========================================================= */

.certificate-modal-backdrop {
    position: absolute;
    inset: 0;

    background:
        rgba(0, 5, 18, 0.58);

    backdrop-filter:
        blur(18px)
        saturate(1.15);

    -webkit-backdrop-filter:
        blur(18px)
        saturate(1.15);

    opacity: 0;

    transition:
        opacity 0.35s ease;
}


.certificate-modal.active
.certificate-modal-backdrop {
    opacity: 1;
}


/* =========================================================
   VENTANA
   ========================================================= */

.certificate-modal-window {
    position: relative;

    z-index: 2;

    width: min(
        1180px,
        calc(100vw - 64px)
    );

    height: min(
        860px,
        calc(100vh - 64px)
    );

    display: flex;
    flex-direction: column;

    overflow: hidden;

    padding: 0;

    border:
        1px solid
        rgba(255, 255, 255, 0.22);

    border-radius: 30px;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.16),
            rgba(255, 255, 255, 0.075)
        );

    box-shadow:
        0 35px 100px
        rgba(0, 0, 0, 0.38),

        inset 0 1px 0
        rgba(255, 255, 255, 0.25);

    backdrop-filter:
        blur(35px)
        saturate(1.25);

    -webkit-backdrop-filter:
        blur(35px)
        saturate(1.25);

    opacity: 0;

    transform:
        translateY(26px)
        scale(0.965);

    transition:
        opacity 0.38s
        cubic-bezier(.22, .61, .36, 1),

        transform 0.38s
        cubic-bezier(.22, .61, .36, 1);
}


.certificate-modal.active
.certificate-modal-window {
    opacity: 1;

    transform:
        translateY(0)
        scale(1);
}


/* =========================================================
   BRILLO AMBIENTAL DEL MODAL
   ========================================================= */

.certificate-modal-window::before {
    content: "";

    position: absolute;

    width: 420px;
    height: 420px;

    top: -250px;
    right: -100px;

    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.12);

    filter: blur(70px);

    pointer-events: none;
}


/* =========================================================
   HEADER
   ========================================================= */

.certificate-modal-header {
    position: relative;

    z-index: 3;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 24px;

    padding:
        24px
        28px;

    border-bottom:
        1px solid
        rgba(255, 255, 255, 0.13);

    background:
        rgba(255, 255, 255, 0.055);
}


.certificate-modal-title {
    min-width: 0;
}


.certificate-modal-title
.organization-label {
    display: block;

    margin-bottom: 5px;
}


.certificate-modal-title h2 {
    margin: 0;

    font-size:
        clamp(
            1.25rem,
            2vw,
            1.75rem
        );

    line-height: 1.1;

    color: #fff;
}


.certificate-modal-title p {
    margin:
        6px
        0
        0;

    color:
        rgba(255, 255, 255, 0.63);

    font-size: 0.9rem;
}


/* =========================================================
   BOTÓN CERRAR
   ========================================================= */

.certificate-modal-close {
    flex: 0 0 auto;

    width: 44px;
    height: 44px;

    display: grid;
    place-items: center;

    padding: 0;

    border:
        1px solid
        rgba(255, 255, 255, 0.18);

    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.09);

    color: #fff;

    font-size: 27px;
    font-weight: 300;

    line-height: 1;

    cursor: pointer;

    backdrop-filter: blur(16px);

    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease;
}


.certificate-modal-close:hover {
    background:
        rgba(255, 255, 255, 0.18);

    border-color:
        rgba(255, 255, 255, 0.32);

    transform:
        rotate(5deg)
        scale(1.06);
}


.certificate-modal-close:active {
    transform: scale(0.95);
}


/* =========================================================
   ÁREA DEL PDF
   ========================================================= */

.certificate-preview-container {
    position: relative;

    flex: 1;

    min-height: 0;

    margin:
        20px
        24px
        0;

    overflow: hidden;

    border:
        1px solid
        rgba(255, 255, 255, 0.16);

    border-radius: 22px;

    background:
        rgba(3, 8, 20, 0.38);

    box-shadow:
        inset 0 1px 0
        rgba(255, 255, 255, 0.08);
}


/* =========================================================
   IFRAME
   ========================================================= */

.certificate-preview {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    border: 0;

    background: transparent;

    opacity: 0;

    transform: scale(0.985);

    transition:
        opacity 0.35s ease,
        transform 0.35s ease;
}


.certificate-preview.loaded {
    opacity: 1;

    transform: scale(1);
}


/* =========================================================
   LOADING
   ========================================================= */

.certificate-loading {
    position: absolute;
    inset: 0;

    z-index: 5;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 14px;

    color:
        rgba(255, 255, 255, 0.72);

    background:
        rgba(0, 5, 18, 0.24);

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}


.certificate-loading.hidden {
    opacity: 0;
    visibility: hidden;
}


.certificate-loading p {
    margin: 0;

    font-size: 0.9rem;
}


.certificate-loading-icon {
    display: block;

    font-size: 27px;

    animation:
        certificateLoadingPulse
        1.2s
        ease-in-out
        infinite;
}


@keyframes certificateLoadingPulse {

    0%,
    100% {
        opacity: 0.35;
        transform:
            scale(0.85)
            rotate(0deg);
    }

    50% {
        opacity: 1;
        transform:
            scale(1.15)
            rotate(90deg);
    }
}


/* =========================================================
   FOOTER / ACCIONES
   ========================================================= */

.certificate-modal-actions {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 12px;

    padding:
        20px
        24px
        24px;
}


.certificate-modal-actions
.btn {
    min-height: 50px;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 9px;

    border-radius: 16px;

    text-decoration: none;

    cursor: pointer;
}


.certificate-modal-actions
.btn span {
    margin: 0;

    font-size: 1rem;
}


/* ACCIÓN PRINCIPAL */

.certificate-modal-actions
.btn-primary {
    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.25),
            rgba(255, 255, 255, 0.13)
        );

    border-color:
        rgba(255, 255, 255, 0.35);

    box-shadow:
        inset 0 1px 0
        rgba(255, 255, 255, 0.28),

        0 12px 28px
        rgba(0, 0, 0, 0.14);
}


/* =========================================================
   MENSAJE COMPARTIR
   ========================================================= */

.certificate-share-message {
    min-height: 0;

    padding:
        0
        24px;

    text-align: center;

    color:
        rgba(255, 255, 255, 0.75);

    font-size: 0.82rem;

    transition:
        opacity 0.25s ease;
}


.certificate-share-message:not(:empty) {
    padding-bottom: 18px;
}


/* =========================================================
   COLOR AMBIENTAL SEGÚN ORGANIZACIÓN
   ========================================================= */

/* AMEMGEN */

body.theme-amemgen
.certificate-modal-window {
    box-shadow:
        0 35px 100px
        rgba(86, 13, 53, 0.42),

        inset 0 1px 0
        rgba(255, 255, 255, 0.25);
}


body.theme-amemgen
.certificate-modal-window::before {
    background:
        rgba(255, 102, 157, 0.22);
}


/* AMEC */

body.theme-amec
.certificate-modal-window {
    box-shadow:
        0 35px 100px
        rgba(2, 12, 44, 0.52),

        inset 0 1px 0
        rgba(255, 255, 255, 0.25);
}


body.theme-amec
.certificate-modal-window::before {
    background:
        rgba(37, 76, 165, 0.25);
}


/* =========================================================
   BOTÓN VER CONSTANCIA
   ========================================================= */

.btn-preview-certificate {
    appearance: none;

    font-family: inherit;

    cursor: pointer;
}


.btn-preview-certificate span {
    display: inline-block;

    transition:
        transform 0.25s ease;
}


.btn-preview-certificate:hover span {
    transform:
        translate(
            3px,
            -2px
        );
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (
    max-width: 768px
) {

    .certificate-modal {
        padding: 12px;
    }


    .certificate-modal-window {
        width:
            calc(100vw - 24px);

        height:
            calc(100vh - 24px);

        border-radius: 24px;
    }


    .certificate-modal-header {
        padding:
            18px
            18px;
    }


    .certificate-preview-container {
        margin:
            12px
            12px
            0;

        border-radius: 17px;
    }


    .certificate-modal-actions {
        grid-template-columns: 1fr;

        padding:
            14px
            12px
            16px;

        gap: 9px;
    }


    .certificate-modal-actions
    .btn {
        width: 100%;
    }

}


/* =========================================================
   RESPETO A REDUCIR MOVIMIENTO
   ========================================================= */

@media (
    prefers-reduced-motion: reduce
) {

    .certificate-modal,
    .certificate-modal-window,
    .certificate-modal-backdrop,
    .certificate-preview,
    .certificate-modal-close,
    .certificate-loading-icon {
        animation: none !important;
        transition: none !important;
    }

}

.copy-email {
    appearance: none;
    border: none;
    padding: 0;
    margin: 0;

    background: transparent;
    color: rgba(255, 255, 255, 0.72);

    font: inherit;
    font-size: inherit;

    cursor: pointer;
    transition:
        color 0.2s ease,
        opacity 0.2s ease;
}

.copy-email:hover {
    color: #ffffff;
    text-decoration: underline;
}

.copy-email:active {
    opacity: 0.65;
}