label:has(+textarea[required])::after,
label:has(+input[required])::after
{
    content: ' *';
    color: red;
}

.errorMessage {
	color: red;
}

#errorMessage:empty {
	display: none;
}

#errorMessage .info-proceso {
	margin-top: 0.75rem;
	margin-bottom: 0;
}

#sp-top-bar {
    background-color: #f5f5f5;
    box-shadow: rgb(92, 92, 92) 0px -1px 12px -6px inset;
    font-size: 15px;
    padding: 0.15rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

#sp-top-bar .container > .row {
    align-items: center;
}

#sp-top-bar ul {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

#sp-top1 ul {
    justify-content: flex-start;
}

#sp-top2 ul {
    justify-content: flex-end;
    gap: 1.25rem;
}

#sp-top-bar li {
    list-style: none;
    padding: 0;
    line-height: 1;
}

#sp-top1 li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

#sp-top1 li a i {
    font-size: 17px;
}

#sp-top1 li a:hover i {
    color: #5a5a5a;
}

#sp-top-bar a {
    font-family: Open Sans, sans-serif;
    color: #8c8c8c;
    text-decoration: none;
}

#sp-top-bar i {
    color: #8c8c8c;
}

#sp-top-bar .sp-contact-info li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

body > header {
    padding: 0;
}

body > header > .container {
    padding-top: 1rem;
    padding-bottom: 0;
}

main > h1 {
    margin-top: 0;
}

/* ===== Formulario: tamaño reducido y filas ===== */

main > h1 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.info-proceso {
    background-color: #f0f7ff;
    border-left: 4px solid #3b82f6;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.info-proceso p {
    margin: 0 0 0.5rem 0;
    color: #1e3a5f;
}

.info-proceso ul {
    margin: 0;
    padding-left: 1.25rem;
    color: #4a5568;
}

.info-proceso li {
    margin-bottom: 0.25rem;
}

.info-proceso .fa-info-circle {
    color: #3b82f6;
    margin-right: 0.25rem;
}

.info-proceso a {
    color: #2563eb;
    text-decoration: underline;
}

/* Variante success */
.info-proceso.info-success {
    background-color: #f0fdf4;
    border-left-color: #16a34a;
}

.info-proceso.info-success p {
    color: #14532d;
}

.info-proceso.info-success .fa-check-circle {
    color: #16a34a;
    margin-right: 0.25rem;
}

/* Variante error */
.info-proceso.info-error {
    background-color: #fef2f2;
    border-left-color: #dc2626;
}

.info-proceso.info-error p {
    color: #7f1d1d;
}

.info-proceso.info-error .fa-exclamation-triangle {
    color: #dc2626;
    margin-right: 0.25rem;
}

.info-footer {
    margin-top: 0.75rem !important;
    font-size: 0.85rem;
}

.errores-registro {
    background-color: #ffffff;
    border: 1px solid #fecaca;
    padding: 0.75rem;
    margin: 0.5rem 0;
    font-size: 0.85rem;
    color: #7f1d1d;
    white-space: pre-wrap;
    word-wrap: break-word;
    border-radius: 4px;
}

#registro legend {
    font-size: 0.9rem;
    font-weight: bold;
    font-style: italic;
    margin-bottom: 0;
    padding-bottom: 0;
}

#registro fieldset {
    margin-bottom: 0;
}

#registro label {
    font-size: 0.8rem;
    margin-bottom: 0.15rem;
}

#registro input[type="text"],
#registro input[type="email"],
#registro textarea,
#registro input[type="file"] {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.5rem;
    height: auto;
    line-height: 1.3;
}

#registro textarea {
    min-height: 5rem;
    resize: vertical;
}

.asunto-counter {
    text-align: right;
    font-size: 0.75rem;
    color: #8c8c8c;
    margin-top: -0.35rem;
    margin-bottom: 0.5rem;
}

/* ===== Spinner overlay para AutoFirma ===== */

.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-overlay[hidden] {
    display: none;
}

.spinner-box {
    background-color: #ffffff;
    padding: 2rem 2.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    max-width: 360px;
}

.spinner-box p {
    margin: 0.75rem 0 0 0;
    font-size: 0.95rem;
    color: #1e3a5f;
    font-weight: bold;
}

.spinner-box .spinner-hint {
    margin-top: 0.25rem;
    font-weight: normal;
    font-size: 0.8rem;
    color: #6b7280;
}

.spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spinner-rotate 0.9s linear infinite;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.form-row--actions {
    grid-template-columns: 1fr auto;
    align-items: end;
}

.form-row .form-field {
    display: flex;
    flex-direction: column;
}

.form-row--actions input[type="submit"] {
    width: auto;
    font-size: 0.85rem;
    padding: 0.35rem 1rem;
    margin: 0 0 0.5rem 0;
    white-space: nowrap;
}

/* Deshabilitar boton Enviar mientras el formulario no sea valido (solo CSS) */
#registro:invalid input[type="submit"] {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.form-footnote {
    font-size: 0.75rem;
    color: #8c8c8c;
    margin-top: 0.5rem;
    margin-bottom: 0;
    text-align: right;
    font-style: italic;
}

.required-mark {
    color: red;
    font-weight: bold;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .form-row--actions {
        grid-template-columns: 1fr;
    }
}