/* ==================== MODAL ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(124, 58, 237, 0.6);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 460px;
    border-radius: 28px;
    padding: 2.5rem;
    box-shadow: 0 30px 40px -10px rgb(192 132 252);
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

#modal-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #4c1d95;
}

/* ==================== FORMULARIO ==================== */
.form-group {
    margin-bottom: 1.5rem;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #6b21a8;
    font-size: 1.05rem;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e0c4f7;
    border-radius: 18px;
    font-size: 1.2rem;
    font-weight: 500;
}

input:focus {
    border-color: #c084fc;
    outline: none;
    box-shadow: 0 0 0 5px rgba(192, 132, 252, 0.25);
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.cancel-button,
.save-button {
    flex: 1;
    padding: 11px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s;
}

.cancel-button {
    background: #f3e8ff;
    color: #9f7aea;
    border: none;
}

.cancel-button:hover {
    background: #e0c4f7;
}

.save-button {
    background: linear-gradient(90deg, #c084fc, #ec4899);
    color: white;
    border: none;
}

#exam-form {
    margin-top: 1rem;
}

/* ==================== SYNC OVERLAY ==================== */
#sync-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(76, 29, 149, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    z-index: 1500;
    flex-direction: column;
    gap: 1.2rem;
}

#sync-overlay.open {
    display: flex;
}

#sync-overlay .spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: white;
    border-radius: 50%;
    animation: syncSpin 0.7s linear infinite;
}

#sync-overlay span {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

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