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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.tabs {
    display: flex;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: #ff4444;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

.tab-btn:hover {
    background: #cc0000;
}

.tab-btn.active {
    background: #ffffff;
    color: #ff4444;
    border: 2px solid #ff4444;
}

.tab-content {
    display: none;
    padding: 20px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(255,0,0,0.1);
}

.tab-content.active {
    display: block;
}

button {
    padding: 10px 20px;
    background: #ff4444;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

button:hover {
    background: #cc0000;
}

.form-container input,
.config-form input,
.config-form textarea {
    border: 1px solid #ff4444;
    outline-color: #ff4444;
}

.form-container {
    margin-bottom: 20px;
}

.form-container input {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    padding: 8px;
}

.certificate {
    width: 100%;
    max-width: 297mm; /* Ancho A4 horizontal */
    min-height: 210mm; /* Alto A4 horizontal */
    margin: 0 auto;
    background: white;
    padding: 0;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.certificate-content {
    border: 2px solid #333;
    width: 100%;
    height: 100%;
    min-height: 208mm; /* 210mm - 2mm de borde */
    padding: 15mm;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
}
.logo {
    max-width: 150px;
    margin: 0 auto;
}
.carnet {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    background: white;
    padding: 0;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    overflow: hidden;
}
/* Estilos minimalistas que no interfieren con la configuración existente */
.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.info-row p {
    margin: 3px 0;
    flex: 1;
}

.info-row p:first-child {
    margin-right: 10px;
}

.carnet-content {
    border: 2px solid #333;
    padding: 15px;
    position: relative;
    min-height: 320px;
    
    /* Configuración mejorada del fondo */
    background-size: 100% 100%; /* Cambiado de 'cover' a '100% 100%' para estirar exactamente */
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    width: calc(100% - 30px); /* Ancho total menos padding */
    aspect-ratio: 90 / 56; /* Proporción basada en tus dimensiones (90.1mm x 56.9mm) */
}

.carnet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.carnet-header .logo {
    max-width: 100px;
    max-height: 50px;
}

.carnet-header h2 {
    margin: 0;
    font-size: 16px;
    color: #333;
    text-align: right;
    flex: 1;
    padding-left: 10px;
}

.carnet-body {
    display: flex;
    flex: 1;
    margin-bottom: 10px;
}

.carnet-photo {
    width: 120px;
    height: 160px;
    overflow: hidden;
    border: 1px solid #ddd;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
}

.carnet-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carnet-info {
    flex: 1;
}

.carnet-info p {
    margin: 5px 0;
    font-size: 14px;
    line-height: 1.4;
}

.carnet-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-top: 1px solid #ddd;
    padding-top: 10px;
}

.carnet-footer img {
    max-width: 120px;
    max-height: 50px;
    margin-bottom: 5px;
}

.carnet-footer p {
    margin: 5px 0 0;
    font-size: 12px;
    color: #666;
    text-align: center;
}

.config-tabs {
    margin-bottom: 20px;
}

.subtab-btn {
    padding: 8px 16px;
    border: none;
    background: #ff6666;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

.subtab-btn:hover {
    background: #ff4444;
}

.subtab-btn.active {
    background: #ffffff;
    color: #ff4444;
    border: 2px solid #ff4444;
}

.subtab-content {
    display: none;
    padding: 15px;
    background: white;
    border-radius: 5px;
}

.subtab-content.active {
    display: block;
}

@media (max-width: 600px) {
    .carnet-body {
        flex-direction: column;
    }
    
    .carnet-photo {
        width: 100px;
        height: 130px;
        margin: 0 auto 15px;
    }
    
    .carnet-info {
        text-align: center;
    }
}
        .container {
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            padding: 30px;
            position: relative;
            margin-bottom: 30px;
        }
        .admin-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
        form {
            display: grid;
            gap: 15px;
        }
        input, select {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
        }
        .btn {
            background-color: #ff0000;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 5px;
            cursor: pointer;
            text-decoration: none;
        }
        .mensaje {
            padding: 10px;
            margin-bottom: 15px;
            border-radius: 5px;
        }
        .mensaje-exito {
            background-color: #dff0d8;
            color: #3c763d;
            border: 1px solid #d6e9c6;
        }
        .mensaje-error {
            background-color: #f2dede;
            color: #a94442;
            border: 1px solid #ebccd1;
        }
        .logout-btn {
            background-color: #333;
            color: white;
            text-decoration: none;
            padding: 8px 15px;
            border-radius: 4px;
        }
     
.intro-text {
    margin: 5px 0; /* Reducido de 10px 0 */
    font-size: 12px; /* Reducido de 14px */
}

.participant-info {
    margin: 10px 0; /* Reducido de 15px 0 */
    max-width: 80%;
    word-wrap: break-word;
    text-align: center;
}
.signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 15px; /* Reducido de 20px */
    width: 70%;
    padding: 0 30px; /* Reducido de 0 50px */
    gap: 30px; /* Reducido de 50px */
}
.signature::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
   
    margin: 5px 0;
}

.signature {
    text-align: center;
    width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.signature img {
    max-width: 150px; /* Reducido de 120px */
    margin-bottom: 5px; /* Reducido de 10px */
}


.signature p {
    border-bottom: none !important;
}

.footer-text {
    margin-top: 5px; /* Reducido de 10px */
    font-size: 10px; /* Reducido de 12px */
    width: 70%;
}

.config-form {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    border: 2px solid #ff4444;
    border-radius: 5px;
    text-align: center;
    margin-bottom: 10px;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input:hover,
.form-group textarea:hover {
    border-color: #cc0000;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff4444;
    box-shadow: 0 0 5px rgba(255,68,68,0.5);
}

.config-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.config-actions button,
.config-form button {
    background: linear-gradient(to bottom, #ffffff 0%, #f2f2f2 100%);
    border: 2px solid #ff4444;
    color: #ff4444;
    padding: 12px 20px;
    text-transform: uppercase;
    font-weight: bold;
    border-radius: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(255,68,68,0.2);
}

.config-actions button:hover,
.config-form button:hover {
    background: #ff4444;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255,68,68,0.3);
}

.config-actions button:active,
.config-form button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(255,68,68,0.2);
}

.certificate-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.certificate-actions button {
    flex: 1;
}

.logo-text {
    margin-top: 20px;
    font-size: 14px;
    color: #333;
    width: 80%;
}